On Wed, Sep 29, 2010 at 12:59 PM, jean polo <josiano....@googlemail.com>wrote:
> Hi. > I get an 'UnicodeEncodeError' if I upload a file (ImageField) with non- > ascii chars in my application (django-1.2.1). > > I added: > > export LANG='en_US.UTF-8' > export LC_ALL='en_US.UTF-8' > > in my /etc/apache2/envvars as stated here: > > http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#if-you-get-a-unicodeencodeerror > > but I still have the same error (after restarting apache). > Any hint much appreciated. > > Some servers do not have the necessary language files to allow successfully setting the locale to one that supports utf-8 encoding. See the very last sentence here: http://code.djangoproject.com/wiki/ExpectedTestFailures You should be able to experiment with setting these variables in a shell session and passing unicode strings containing non-ASCII characters to file system routines like stat. If it works in a shell, then likely you've got the necessary language support installed, and the problem then is that the Apache configuration for some reason is not taking effect. If you cannot get it to work in a shell either, then likely you are missing a language pack that would allow successfully setting locale in this way. Karen -- http://tracey.org/kmt/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.