Printing Unicode characters

Blistex me at privacy.net
Wed Aug 7 19:30:54 EDT 2002


I'm testing how well my application handles Unicode characters and I have
a snippet of code that looks like this:

for x in range(0x20, 0x7F):
	print u'\u%x' % (x)

but I have a problem with trying to get print to properly interpret the
Unicode (the \u requires a form of \uXXXX).

Has anyone tackled anything similar or is there an elegant solution to
this?  I know I can cobble together something ugly but I'd prefer a
"prettier" solution.  Thanks.

P.S.  I've been studying Python for a day and a half now and it's so
clean compared to Perl, I love it.



More information about the Python-list mailing list