[Tutor] unsupported characters
Robert Johansson
robert.johansson at math.umu.se
Tue Aug 19 00:17:34 CEST 2008
On 8/17/08, Robert Johansson <robert.johansson at math.umu.se> wrote:
> Hi, I have problems using characters from the Swedish language. I tried
the
> following in IDLE under MacOS X leopard (running Python 2.5.1) :
> S='ö'
> Displaying error message: "unsupported characters in input".
To use non-ascii characters in Python code you have to declare the
encoding of the source file with a comment such as
# coding=UTF-8
See http://python.org/dev/peps/pep-0263/
Kent
Thanks for taking you time with this. Yes, that works. I know that you can
declare the encoding for a script in that way but there is still a problem
when I use the shell as input device. There are options for encoding in the
menu for IDLE but changing them doesn't help at all. I've tried two versions
of IDLE but both seem to be a bit buggy (scrolling doesn’t work, etc). If
there are any Mac users who read this, which editor would you recommend for
Mac?
/Robert
More information about the Tutor
mailing list