Skip to content

Commit

Permalink
Adding utf-8-sig to address UTF files with BOM. Addressing issue #22151.
Browse files Browse the repository at this point in the history
  • Loading branch information
tinodj committed Aug 24, 2023
1 parent 8f7a4f6 commit 0fd67f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/utils/csvutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def read_csv_content_from_attached_file(doc):
def read_csv_content(fcontent):
if not isinstance(fcontent, str):
decoded = False
for encoding in ["utf-8", "windows-1250", "windows-1252"]:
for encoding in ["utf-8-sig", "utf-8", "windows-1250", "windows-1252"]:
try:
fcontent = str(fcontent, encoding)
decoded = True
Expand Down

0 comments on commit 0fd67f8

Please sign in to comment.