[Tutor] unicode and character sets

tpc247 at gmail.com tpc247 at gmail.com
Fri Aug 17 07:39:44 CEST 2007

On 8/16/07, Kent Johnson <kent37 at tds.net> wrote:
> tpc247 at gmail.com wrote:
> Good start!

thanks, one of the good folks at metafiler provided the link to an excellent
introductory article

I don't think this is necessary. Did it actually fix anything? Changing
> the default encoding is not recommended because it makes your scripts
> non-portable.

indeed, putting the sitecustomize.py script in site-packages did nothing to
help me generate a script that would print out the non-ASCII character in
IDLE, and, if what you say is correct, may very well introduce new problems.

In many cases IDLE will display the repr() of a string which shows any
> non-ascii character as a hexidecimal escape. It is actually the correct
> character. print does not use the repr() so it displays correctly.

ah, I see.  Any string not ASCII encoded, generated by my script in IDLE,
will be displayed as hexadecimal.  Essentially, I was in a round house
trying to find the corner !

No, actually you are doing great. This is correct output, it is just not
> displaying in the form you expect. The data is correct.

after reading your email, I wrote a follow-up script that wrote the
generated output to a file in my Apache document root, and eureka, I was
able to get the result I desired.  Thanks for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070816/539f2c65/attachment.html 

More information about the Tutor mailing list