Help needed: Printing unicode characters in user defined format

Pekka Niiranen pekka.niiranen at
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:


should be written into file like this:



More information about the Python-list mailing list