How to decode a string

Lad python at hope.cz
Tue Aug 22 07:06:58 EDT 2006


Fredrik Lundh wrote:
> Lad wrote:
>
> > for
> > print repr(RealName)  command
> > I will get
> >
> > P?ibylov\xe1 Ludmila
> > where instead of  ? should be also a character
>
> that's not very likely; repr() always includes quotes, always escapes
> non-ASCII characters, and optionally includes a Unicode prefix.
>
> please try this
>
>    print "*", repr(RealName), type(RealName), "*"
>
> and post the entire output; that is, *everything* between the asterisks.
>
The result of print "*", repr(RealName), type(RealName), "*" is

* 'Fritschov\xe1 Laura' <type 'str'> *


Best regards,
L




More information about the Python-list mailing list