How to overcome automatic cyrillic-to-/hex convert

Florian Diesch diesch at spamfence.net
Sun Jun 12 14:26:57 EDT 2005


<degoor_python at dir.bg> <degoor_python at dir.bg> wrote:
> But when I enter some Bulgarian (actually cyrillic) text as a string,
> it
> seems that Python automatically converts it to '\x00..\x00 ' and once
> converted that way I can't get it back into its original look. The only
> way to get it right is using print :
>
>>>> a = 'ÌÀÌÀ' # 'Mam' in Bulgarian
>>>> print a
> 'ÌÀÌÀ'
>
> but
>
>>>> a
> '\xcc\xe0\xec\xe0'


Did you try the locale module?


   Florian
-- 
begin  signature_virus
 Hi! I'm a signature virus. Please copy me to your signature to help me spread.
end



More information about the Python-list mailing list