Browse Source

fix: prioritize Japanese encodings in CSV reading

mrh (aider) 1 năm trước cách đây
mục cha
commit
667e1d9360
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      mylib/read_encoding_cvs.py

+ 2 - 2
mylib/read_encoding_cvs.py

@@ -54,8 +54,8 @@ def read_csv(file_path: str) -> List[List[str]]:
     Returns:
         包含CSV数据的二维列表
     """
-    # 常见编码列表,按优先级排序
-    encodings_to_try = ['utf-8-sig', 'gb18030', 'shift_jis', 'euc-jp', 'iso-8859-1', 'latin1']
+    # 常见编码列表,按优先级排序,优先尝试日文编码
+    encodings_to_try = ['shift_jis', 'euc-jp', 'utf-8-sig', 'gb18030', 'iso-8859-1', 'latin1']
     
     # 先尝试检测编码
     detected_encoding = detect_encoding(file_path)