Wednesday, September 29, 2010

Re: UnicodeEncodeError

It sounds to me as though the image is being transmitted with the wrong
MIME Type. Image files are binary data, but something in your
application is treating is as a string.

regards
Steve

On 9/29/2010 1:05 PM, werefr0g wrote:
> Hi,
>
> You should check that your file is actually utf-8 encoded and add the
> folliwing right after shebang:
> # -*- coding: utf-8 -*-
>
> Le 29/09/2010 18:59, jean polo a écrit :
>> 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.
>>
>> cheers,
>> _y
>>
>> ps:
>>
>> Traceback (most recent call last):
>> [snip]
>> File "/usr/languages/python/2.6/lib/python2.6/genericpath.py", line
>> 18, in exists
>> st = os.stat(path)
>>
>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in
>> position 53: ordinal not in range(128)
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.


--
DjangoCon US 2010 September 7-9 http://djangocon.us/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment