> 1. Recommend it in the official document "Using Python on Windows" [2].
> 2. Show the UTF-8 mode status in the command line mode header [3] on
Windows.
> 3. Show the link to the UTF-8 mode document in the command line mode
header too.
> 4. Add checkbox to set "PYTHONUTF8=1" environment variable in the
installer.

> How do you think?

At the least, I'm in favor of recommending UTF-8 mode in the documentation
for Windows users. It seems like it would fit well under the "Configuring
Python" section of the page (
https://docs.python.org/3/using/windows.html#configuring-python).

I'm undecided on the others, as I don't know what (2) and (3) would
specifically entail. As far as (4) goes:

> If setting "PYTHONUTF8=1" environment variable is too danger
> to recommend widely, we may be able to add per-installation
> (and per-venv if needed) option file (site.cfg in the directory same to
> python.exe) to enable UTF-8 mode.

Would you mind elaborating on this point? In particular, what specific
dangers/risks might be associated with setting that specific env var during
installation? IIRC, the installer already configures a few others by
default (I don't recall their names).

> But it may make Python startup process more complex...

I would definitely prefer to have a checkbox to configure "PYTHONUTF8"
during installation rather than requiring it to be done manually, assuming
it can be done safely and effectively across different systems. Not only
for the sake of lowering complexity, but also because it takes less time
and effort. That can add up significantly when you consider the volume of
users.

On Fri, Jan 10, 2020 at 6:47 AM Inada Naoki <songofaca...@gmail.com> wrote:

> Hi, all.
>
> I believe UTF-8 should be chosen by default for text encoding.
>
> * The default encoding for Python source file is UTF-8.
> * VS Code and even notepad uses UTF-8 by default.
> * Text files downloaded from the Internet is probably UTF-8.
> * UTF-8 is used when you use WSL regardless your system code page.
> * Windows 10 (1903) adds per-process option to change active code page
> to UTF-8 and call the system code page "legacy". [1]
>
> But it is difficult to change the default text encoding of Python
> for backward compatibility.  So I want to recommend the UTF-8 mode:
>
> * The default text encoding become UTF-8
> * When you need to use legacy ANSI code page, you can
>   use "mbcs" codec.
> * You can disable it when you need to run Python application
>   relying on the legacy system encoding.
>
> But it is not well known yet.  And setting the environment variable
> is a bit difficult for people who are learning programming with Python.
>
> So I want to propose this:
>
> 1. Recommend it in the official document "Using Python on Windows" [2].
> 2. Show the UTF-8 mode status in the command line mode header [3] on
> Windows.
> 3. Show the link to the UTF-8 mode document in the command line mode
> header too.
> 4. Add checkbox to set "PYTHONUTF8=1" environment variable in the
> installer.
>
> How do you think?
>
> If setting "PYTHONUTF8=1" environment variable is too danger
> to recommend widely, we may be able to add per-installation
> (and per-venv if needed) option file (site.cfg in the directory same to
> python.exe) to enable UTF-8 mode.
> But it may make Python startup process more complex...
>
> Regards,
>
> [1]:
> https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page
> [2]: https://docs.python.org/3/using/windows.html
> [3]: Currently, Python version and "Type "help",..." are printed.
>
> --
> Inada Naoki  <songofaca...@gmail.com>
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/524JQFZ4RMRLU7DBPSQDR735Z2UMSWQG/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/2PFSB6AZZDAY32HFCMCVTO5NHATIXOP7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to