Help needed: Printing unicode characters in user defined format

Pekka Niiranen pekka.niiranen at wlanmail.com
Thu Oct 21 20:50:00 CEST 2004


Hi there,

how can I write out Python Unicode character's
hexadecimal value in generic format?

I need to loop thru characters in Unicode string
and store each character in format \U+hhhh, where
hhhh is the value of unicode character in hexadecimal?

For example string:

u'Hellö'

should be written into file like this:

'\U+0048\U+0065\U+006C\U+006C\U+00F6'


-pekka-



More information about the Python-list mailing list