[Python-Dev] PEP 263 considered faulty (for some Japanese

Paul Svensson paul@svensson.org
Sun, 17 Mar 2002 21:27:39 -0500 (EST)


On 18 Mar 2002, Stephen J. Turnbull wrote:

>Emacs naming compatibility is of ambiguous value in the current form
>of the PEP, since the cookie only applies to Unicode string literals.
>The Emacs coding cookie applies to the whole file.  So this means that
>to implement a Python mode that allows (eg) a hexl mode on ordinary
>string literals but regular text mode on Unicode string literals,
>Emacs must _ignore_ Python coding cookies!

Since the proposal explicitly allows only encodings that are strict
supersets of ASCII, the whole file _is_ using (a subset of) the encoding
specified by the cookie.  So, if Emacs recognizes the cookie, it will allow
you to edit both code and unicode strings, as text.  If you need to put
non-ASCII data in regular strings, not using the specified encoding, then
write them as \xNN-escapes.

	/Paul