>> 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.

You have, most definitely, made a selection when choosing a system
that came with "English" Windows preinstalled. If you hadn't wanted
to use "English" Windows, you would either have asked for a different
preinstallation, or installed some other language version.

That you are unaware of actually having made that decision is likely
because you live in an environment where there is a single predominant
language, so vendors actually know the preference of their customers
very well.

Indeed, at my work place, the administrators always ask "German or
English windows?". They would ask the same question when buying
keyboards, except that people so often respond so often asking for
a German keyboard that they stopped asking, making the German keyboard
the default - even when used with an English windows installation.

> 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.

That's even more reason to have Python programs use the choice somebody
else made for you. If you open a text file with a text editor, the text
editor will also make a choice of text encoding. It would be good if
Python made the same choice - so that you can actually read the text
that a Python script put into the file.

If you, as an end user, would have to make a selection, you wouldn't be
able to make a good choice, as you don't even know what encoding is
typically used on your system.

> 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?

That depends on the operating system. For U.S./Western Windows, it's
code page 1252. Microsoft doesn't support changing it to UTF-8
(although they do support changing it to other values). To verify
that you are still using the vendor default, check out the regional
settings in control panel.

Regards,
Martin
_______________________________________________
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