Inada Naoki wrote:
> Current header is:

> Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC
> v.1916 64 bit (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.

> I'm proposing adding one more line:

> UTF-8 mode is disabled. (See https://url.to/utf8mode)

Ah, that should be fine. I don't have any issues with (2) and (3) then.

Inada Naoki wrote:
> If the Python installer set PYTHONUTF8=1 environment variable,
> it may affects applications using embeddable Python or py2exe.

> So it may break applications which assume the default text
> encoding is "mbcs".

In that case, I think we should hold off on (4) until it's tested for a
decent variety of different applications, or at the least consider leaving
it off by default (unticked checkbox) with a note of some form that warns
users of the possible legacy incompatibility with MBCS.

I'll admit though that I have no experience working with any application
that implicitly assumes MBCS is the default encoding format, is this a
common occurrence in some older applications? I could imagine this being
the case in legacy applications that need international encoding, but I
have zero idea of how common it is in reality.

As a side note, Microsoft recommends not using MBCS for encoding in newer
applications in their Visual C++ docs:

"MBCS is a legacy technology and is not recommended for new development." (
https://docs.microsoft.com/en-us/cpp/text/support-for-multibyte-character-sets-mbcss?view=vs-2019
).

This might also be useful for getting a general idea of MBCS expectations
when it comes to Windows development, although some of it is specific to
C++:
https://docs.microsoft.com/en-us/cpp/text/general-mbcs-programming-advice?view=vs-2019
.

On Sun, Jan 12, 2020 at 1:28 AM Inada Naoki <songofaca...@gmail.com> wrote:

> On Sat, Jan 11, 2020 at 11:03 AM Kyle Stanley <aeros...@gmail.com> wrote:
> >
> > > 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.
>
> Current header is:
>
>   Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC
> v.1916 64 bit (AMD64)] on win32
>   Type "help", "copyright", "credits" or "license" for more information.
>
> I'm proposing adding one more line:
>
>   UTF-8 mode is disabled.  (See https://url.to/utf8mode)
>
>
> > 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).
> >
>
> If the Python installer set PYTHONUTF8=1 environment variable,
> it may affects applications using embeddable Python or py2exe.
>
> So it may break applications which assume the default text
> encoding is "mbcs".
>
>
> > > 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.
> >
>
> Even when we add per-installation config file, we can add it from
> the Python installer.
>
>
> --
> 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/D337PG5Z3KW4DC3RQTSGHXHL3JWK5LJY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to