How to decode a string

Lad python at hope.cz
Tue Aug 22 10:39:36 EDT 2006


Fredrik Lundh wrote:
> "Lad" wrote:
>
> > The result of print "*", repr(RealName), type(RealName), "*" is
> >
> > * 'Fritschov\xe1 Laura' <type 'str'> *
>
> looks like the MySQL interface is returning 8-bit strings using ISO-8859-1
> encoding (or some variation of that; \xE1 is "LATIN SMALL LETTER A
> WITH ACUTE" in 8859-1).
>
> have you tried passing "use_unicode=True" to the connect() call ?
>
> </F>

Frederik,
Thank you for your reply.
I found out that if I do not decode the string at all, it looks
correct. But I do not know  why it is ok without decoding.
I use Django and I do not use use_unicode=True" to the connect() call.




More information about the Python-list mailing list