Closed hachacha closed 2 years ago
Yes, we should always assume UTF-8 encoding for web uploads (and probably return an error message when not, instead of raising a 500), so setting the encoding when calling open()
would be best.
Your Ubuntu system probably has set the locale enviroment variables to something other than UTF-8.
On Article Metadata upload, it refused to render the "example/preview" page of the csv after uploading. I was able to get around it by adding
file = open(path, 'r', encoding="utf-8")
on theimport_action
function within views.pyThe strange thing is that this didn't happen on my local which is just run from runserver but it did happen on the staging server -- Aapache and Ubuntu 18.04. Any thoughts about this? Is the fix appropriate or should people be limited to a certain character set?