error when printing a UTF-8 string (python 2.6.2)

fab at slick.airforce-one.org fab at slick.airforce-one.org
Wed Apr 21 05:29:21 EDT 2010


> Change your string literals to unicode by adding the u-prefix and you should 
> be OK.

Thanks, it solved the problem... for a while!

I need now to know if s[i] gives the next byte or the next character,
when I scan the string s. I've googled pages about python and unicode,
but didn't find a solution to that. I scan the string read from the
file char by char to construct s, but now get the same error when just
trying 'print s'.

Is there a way to tell python that all strings and characters are to
be treated as UTF-8? I have LC_ALL=en_GB.utf-8 in my shell, but python
does'nt seem to use this variable?

Thanks!

-- 
Fabrice DELENTE



More information about the Python-list mailing list