handling unicode data

"Martin v. Löwis" martin at v.loewis.de
Tue Jul 4 14:12:02 EDT 2006


Filipe wrote:
> term = row[1]
> print repr(term)
> 
> output I got in Pyscripter's interpreter window:
> 'Fran\x87a'
> 
> output I got in the command line:
> 'Fran\xd8a'
> 
> I'd expect "print" to behave differently according with the console's
> encoding, but does this mean this happens with repr() too?

repr always generates ASCII bytes. They are not effected by the
console's encoding. If you get different output, it really means
that the values are different (check ord(row[1][4]) to be sure)

What is the precise sequence of statements that you used to
set the "row" variable?

Regards,
Martin



More information about the Python-list mailing list