Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a user enters an odd filename, the instructor can't retrieve it. UnicodeEncodeError: 'latin-1' codec can't encode character #134

Open
e271 opened this issue Oct 19, 2015 · 1 comment

Comments

@e271
Copy link

e271 commented Oct 19, 2015

If a student use some strange character in the filename, the instructor can't retrieve the file. Probably there should be some sort of limitations on the characters of the filenames, maybe change the characters them to avoid such issues.

Last part of the log:

File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/webob/descriptors.py", line 142, in fset
value = value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2013' in position 45: ordinal not in range(256)

@MalkavianBilbao
Copy link

I have same problem and made some tests from Windows, Linux, MacOS and an Iphone. The problem only occurs when all this conditions are fulfilled when uploading:

1- The file have some symbol existent in spanish (and probably other languages) but not in english (áéíóúñ€ ...).
2- The file is uploaded from a computer with MacOS.
3- The browser is NOT Safari (Firefox, Google Chrome...).

Uploading files to OpenEdx (instead to edx-sga) result in files renamed to avoid these problems, so maybe the code from OpenEdx file uploading form could be used.

People talk here about a related problem and a solution in PHP:
https://wpfilebase.com/forums/topic/filename-encoding-problem-based-on-os-and-browser-combination/
(And here years ago, with reference to more related bugs. Comments here could give maybe more info: https://bugzilla.mozilla.org/show_bug.cgi?id=968142 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants