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
Describe the bug
Only files encoded with UTF8 without BOM marker are accepted now, but trying to upload UTF16 fails with an exception that doesn't point out this issue.
Steps To Reproduce
Create batch import using CSV, try these select files:
The issue was that all CSV files were being read in UTF-8 format, causing failures when importing UTF-16 encoded files.
- Added support for detecting file encoding using the popular Python library chardet.
- If chardet fails to recognize the encoding, explicitly handle the files as UTF-16.
This change ensures proper handling of both UTF-8 and UTF-16 encoded CSV files.
Fixesopenwisp#550
akhilsharmaa
added a commit
to akhilsharmaa/openwisp-radius
that referenced
this issue
Nov 22, 2024
The issue was that all CSV files were being read in UTF-8 format, causing failures when importing UTF-16 encoded files.
- Added support for detecting file encoding using the popular Python library chardet.
- If chardet fails to recognize the encoding, explicitly handle the files as UTF-16.
This change ensures proper handling of both UTF-8 and UTF-16 encoded CSV files.
Fixesopenwisp#550
Describe the bug
Only files encoded with UTF8 without BOM marker are accepted now, but trying to upload UTF16 fails with an exception that doesn't point out this issue.
Steps To Reproduce
Create batch import using CSV, try these select files:
Expected behavior
A clear error message or handling the encoding automatically.
Screenshots
The text was updated successfully, but these errors were encountered: