django filebrowser decoding

22 views
Skip to first unread message

Emīls Brass

unread,
Oct 29, 2015, 5:08:00 PM10/29/15
to Django users
I got django filebrowser for admin, where admin can see all added files in special folder.

When admin click on folder to see whats inside, if there is some file with name who contains UNICODE chartacter, then I shows 500 error, but if not, everything is working.

We exported this webpage to new server, on old server everything where working good, but on new server we got this problem, but all website file are the same, so, I think that problem could be in some python libary files, I need some plugin or something like that to be installed, but what?

Example:
Userfiles/folder1/abcde.pdf - all working good
Userfiles/folder2/ābčdē.pdf - not working, 500 error

On log file I got this message - UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128)

Dheerendra Rathor

unread,
Oct 29, 2015, 5:38:19 PM10/29/15
to Django users
Do you have the full stacktrace? Can you post that here?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7657a070-5f0b-45d7-b66f-6ff13793d7c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Evans

unread,
Oct 29, 2015, 9:15:14 PM10/29/15
to django...@googlegroups.com
The locale on the new server is the C locale, and is not the same as
the locale on the old server, which was some UTF-8 locale.

Consult the documentation for the webserver you use to host django,
and ensure that the LANG is set appropriately. Searching google for
"<name of web server> LANG" should show appropriate results.

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages