On 1/23/2010 2:53 AM, "Martin v. Löwis" wrote:

So for the limited case of text IO, Python 3.x now makes a guess.
However, this guess is not in the face of ambiguity: it is the
locale that the user (or his administrator) has selected,

That is a mistaken assumption for many. I have never, that I know of, selected a locale on any of about 10 dos and windows machnes I have used and administered. It is whatever Microsoft or the computer manufacturer selected for machines sold in the U.S. Maybe things are different in Europe.

> which
identifies the language that they speak and the character encoding
they use for text.

I have in the past changed the encoding for outgoing email from whatever limited extended-ascii encoding MS or whoever set, to utf-8, but I have never, I am really sure, selected a default text file encoding. I have no idea if I can even change it, or even what it is.

If the current guess is based on a mistaken assumption -- that it is giving the user what the user asked for -- it might be reconsidered. I personally would prefer that the default file encoding for Python 3 be utf-8 on any machine my code runs on unless *I* or the *user*, rather than some anonymous third party, ask otherwise. That would make files guaranteed portable unless asked to not be. It would seem better to me than some unknown value set by some unknown person. This seems counter to Python's general policy of operating consistently across machines and operating systems.

> So if Python also uses that encoding, it's not
really an ambiguous guess.

It is unknown to me as the user. How do I find out what the default text file encoding is on my machine, in case it is not utf-8?

Terry Jan Reedy


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to