[Pythonmac-SIG] Piddle, Python and Umlauts
John W. Baxter
jwblist at olympus.net
Tue Sep 2 18:55:03 EDT 2003
On 9/2/2003 8:34, "Jörg Kantel" <kantel at mpiwg-berlin.mpg.de> wrote:
> Dear all,
>
> it's me again ;o) After I've played a little bit around with piddle
> I've two comments/questions:
>
> I was running this programm which still works with MacPython 2.2.2 (OS
> X): <http.//www.pythonmania.de/mandelbrotpy/>
>
> 1. piddleQD seems to be broken. I've implemented my own patches
> <http://www.pythonmania.de/piddleosx/> but I still got a deprecation
> warning (integer expected, got float) and at least an error:
>
> ImportError: No module named img
> File "PixMapWrapper.py", line 12, in ?
> import img
>
> 2. The same program with TK runs (with pythonw from the terminal), but
> it still got a deprecation warning (integer expected, got float). And
> it's shows a strange behaviour with german umlauts: The "ä" (a-Umlaut)
> in
>
> root.title("Apfelmännchen")
>
> will not shown, I've got another warning instead: DeprecationWarning:
> Non-ASCII character '\x8a' in file /Users/kantel/Desktop/apfelmtk.py on
> line 40, but no encoding declared.
>
> What's going wrong or what changed in Python 2.3? I'm a little bit
> concerned about that. Then sure, I've a lot of code running in Python
> with German Umlauts in string constants. Will that work further more
> without changing the code?
>
> Many thanks in advance (and once again: Excuse my bad (d)english)
> J"org Kantel
For what's new in Python 2.3, see http://www.python.org/doc/2.3/whatsnew/
For the above issue, look at item 3 in the list:
3 PEP 263: Source Code Encodings
And then go on to the PEP itself:
http://www.python.org/peps/pep-0263.html
Basically, you can declare the encoding of a source file so that the
non-ASCII characters are understood as intended. Sample
> #!/usr/bin/env python
> # -*- coding: UTF-8 -*-
The declaration must be very early in the source file (see the PEP).
Identifiers are still restricted to a subset of ASCII characters.
(No ASCII character has a 1 in the high order bit.)
--John
More information about the Pythonmac-SIG
mailing list