You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading CSV for import, from CSV file with BOM (which is default under Excel/MacOS ) the first column name is read together wit the BOM characters - therefore it is never recognized and needs to be mapped manually. Workaround is - add empty column ad the beginning that will be ignored.
Proposed solution is add utf-8-sig encoding on this line:
Hey @tinodj, Included the fix for this in my #26183 pull request.
One note on your original pull request, It's not enough to update only the csvutils.py, as csv files are plaintext files, and first will be decoded in file.py, and became instantly incorrectly decoded.
When reading CSV for import, from CSV file with BOM (which is default under Excel/MacOS ) the first column name is read together wit the BOM characters - therefore it is never recognized and needs to be mapped manually. Workaround is - add empty column ad the beginning that will be ignored.
Proposed solution is add utf-8-sig encoding on this line:
https://github.com/frappe/frappe/blob/8f7a4f6697bd732a712cf582c2f321dc67c73629/frappe/utils/csvutils.py#L42C3-L42C61
I am open for other solutions as well - such as removing BOM characters at the beginning of the file if found.
The text was updated successfully, but these errors were encountered: