| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
In some places, "utf-8" is used, in some other places "UTF-8" is used. I suggest to use lower case "utf-8" everywhere: doc, C code, _Py_STR(), etc. You may have to update getpreferredencoding() doc.
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
||
| .. versionchanged:: 3.7 | ||
| The function now always returns ``UTF-8`` on Android or if the | ||
| The function now always returns ``"UTF-8"`` on Android or if the |
There was a problem hiding this comment.
| The function now always returns ``"UTF-8"`` on Android or if the | |
| The function now always returns ``"utf-8"`` on Android or if the |
Sorry, something went wrong.
|
|
||
| .. versionchanged:: 3.11 | ||
| The function now returns ``"utf-8"`` instead of ``"UTF-8"`` on Android | ||
| or if the :ref:`Python UTF-8 Mode <utf8-mode>` is enabled. |
There was a problem hiding this comment.
I am sure that the upper case versus lower case is worth to be mentioned. But I'm fine with keeping if you consider that it's worth it.
Sorry, something went wrong.
| argument are ignored. | ||
|
|
||
| The :ref:`Python preinitialization <c-preinit>` configures the LC_CTYPE | ||
| locale. See also the :term:`filesystem encoding and error handler`. |
There was a problem hiding this comment.
I suggest to copy/paste this paragraph to getencoding() doc.
Sorry, something went wrong.
| ------ | ||
|
|
||
| * Add :func:`locale.getencoding` to get the current locale encoding. It is similar to | ||
| ``locale.getpreferredencoding(False)`` but ignores :ref:`UTF-8 Mode <utf8-mode>`. |
There was a problem hiding this comment.
I like repeating "Python" to remind that it's unrelated to the Unix locale, but really something specific to Python which ignores the locale.
| ``locale.getpreferredencoding(False)`` but ignores :ref:`UTF-8 Mode <utf8-mode>`. | |
| ``locale.getpreferredencoding(False)`` but ignores the :ref:`Python UTF-8 Mode <utf8-mode>`. |
Sorry, something went wrong.
| @@ -0,0 +1 @@ | |||
| Add :func:`locale.getencoding`. | |||
There was a problem hiding this comment.
You can copy/paste the Doc/whatsnew/3.11.rst entry entry.
Sorry, something went wrong.
| ``locale.getencoding()`` can be used to get the locale encoding. | ||
|
|
||
| Python uses the :term:`filesystem encoding and error handler` to convert | ||
| between Unicode filenames and bytes filenames. |
There was a problem hiding this comment.
IMO it would be helpful to mention here the Python UTF-8 Mode which ignores the locale encoding and always uses UTF-8. What do you think?
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think so. This paragraph doesn't describe where the locale encoding is used.
This paragraph describes what the locale encoding is.
With this pull request, locale encoding is locale encoding even in UTF-8 mode.
On the other hand, following this paragraph looks unnecessary:
Python uses the :term:`filesystem encoding and error handler` to convert
between Unicode filenames and bytes filenames.
I will replace it with See also :term:`filesystem encoding and error handler`.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. Thanks.
IMO it's important that the current is complete and explains well this function, since it's a complex topic. If the doc is unclear, people will misuse it.
Thanks for adding "See also the filesystem encoding and error handler" in the glossary, that's good!
I'm not sure why the PR is still a draft.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This API is a part of PEP 686.
https://bugs.python.org/issue47000