[Python-3000] Displaying strings containing unicode escapes

"Martin v. Löwis" martin at v.loewis.de
Mon May 5 18:30:30 CEST 2008


> Using the names gets fairly verbose compared to the hex escapes though:
> 
>>>> u"\N{GREEK SMALL LETTER ALPHA}"
> u'\u03b1'
>>>> u"\N{GREEK CAPITAL LETTER ALPHA}"
> u'\u0391'
>>>> u"\N{GREEK CAPITAL LETTER ALPHA WITH TONOS}"
> u'\u0386'

The extreme case (in Python 2.5) is

py> u"\N{ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF
MAKSURA ISOLATED FORM}"
u'\ufbf9'


Regards,
Martin


More information about the Python-3000 mailing list