Typing UTF-8 characters in IDLE

"Martin v. Löwis" martin at v.loewis.de
Sat Feb 7 03:28:28 EST 2004


Ricky Waller wrote:
> A few unicode tutorials on the web show that it's possible to type
> unicode characters into the IDLE gui...
> 
> However, when i type korean (hangul) characters it complains:
> 
> Unsupported Characters in input
> 
> I don't have a great understanding of unicode, but when I use a UTF-8
> source file with korean strings in, and run it as a CGI script it
> works fine.

It is possible to put non-ASCII characters into source code in an
IDLE text editor window. Make sure you have an encoding declaration
in the file as well before saving it.

It is also possible to enter non-ASCII characters in interactive
mode. IDLE will convert them to the locale's encoding before
evaluating the source code; if that fails, you get the message you
see. So where you trying to enter hangul characters in interactive
mode in a locale that does not support hangul, or are you lacking
a codec for your locale?

In interactive mode, UTF-8 is never used (unless you have an
UTF-8 locale).

Regards,
Martin




More information about the Python-list mailing list