Answer the question
In order to leave comments, you need to log in
UnicodeEncodeError on Apache2 with mod_wsgi on Debian lenny?
There is a model in which there is an ImageField, in the admin panel in the display of the list of objects the file name and preview are displayed.
If I upload a file with Russian characters in the name, then when the list is displayed, I get a UnicodeEncodeError.
Apache is running as user www-data, which has all locales "en_US.UTF-8".
A Google search found a recommendation to write in /etc/apache2/envvars LANG="en_US.UTF-8" and LC_ALL="en_US.UTF-8". Tried it didn't help.
UDT:
Found that
1) crashes on line st = os.stat(path)<br>
2) locale.getdefaultlocale() returns (None, None)
UDT2
Installed in django.wsgi
os.environ['LANG']='en_US.UTF-8'<br>
os.environ['LC_ALL']='en_US.UTF-8'<br>
Answer the question
In order to leave comments, you need to log in
Is the field in the database and the base exactly in utf-8?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question