Преглед на файлове

[Bug Fix] Fix issue of loading other languages in csv file (#1225)

Youbin Choi преди 1 година
родител
ревизия
fb0852f585
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      embedchain/loaders/csv.py

+ 2 - 2
embedchain/loaders/csv.py

@@ -27,9 +27,9 @@ class CsvLoader(BaseLoader):
             return StringIO(response.text)
         elif url.scheme == "file":
             path = url.path
-            return open(path, newline="")  # Open the file using the path from the URI
+            return open(path, newline="", encoding="utf-8")  # Open the file using the path from the URI
         else:
-            return open(content, newline="")  # Treat content as a regular file path
+            return open(content, newline="", encoding="utf-8")  # Treat content as a regular file path
 
     @staticmethod
     def load_data(content):