"Martin v. Loewis" wrote:
"M.-A. Lemburg" email@example.com writes:
He also told me that they put raw Shift-JIS and EUC-JP into Python literal strings -- just like Europeans do with Latin-1.
I expected that much; chosing Latin-1 as the default encoding is certainly Euro-centric.
At the moment, declaring either eucJP or or Shift-JIS wouldn't work with the proposed implementation, anyway, since those encodings are not supported in the standard Python installation.
But they will be using Tamito's Japanese codecs... and, of course, they do work now in string literals, since there is no enforcement of any encoding in the compiler.
Wouldn't his suggestion be a good compromise for phase 2 ?
This raises the question what exactly should be deprecated. AFAIK, both eucJP and Shift-JIS use non-ASCII bytes to denote Japanese characters, so they'd get a DeprecationWarning on every file. However, they could not put an encoding declaration into the file, as Python would not recognize the encoding.
With Tamito's codecs installed, this wouldn't be a problem. Putting the encoding comment in the files will turn the compiler quiet in phase 1 and in phase 2 assure that their editors do in fact use the defined encoding.
FYI, I've updated the PEP to use the interpreter's default encoding as basis for the source file encoding too.
-- Marc-Andre Lemburg CEO eGenix.com Software GmbH