This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [doc] Encoding declaration: doc supported encodings
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ksameersrk, martin.panter, miss-islington, terry.reedy
Priority: normal Keywords: easy, patch

Created on 2015-07-03 23:38 by terry.reedy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
encoding_links.patch ksameersrk, 2015-07-08 16:00 Added links to Standard Encodings and Python Specific Encodings review
Pull Requests
URL Status Linked Edit
PR 32274 merged terry.reedy, 2022-04-02 23:54
PR 32275 merged miss-islington, 2022-04-03 00:13
PR 32276 merged miss-islington, 2022-04-03 00:13
Messages (8)
msg246233 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-07-03 23:38
The source .rst for 
<https://docs.python.org/3/reference/lexical_analysis.html#encoding-declarations>
has at the end:
.. XXX there should be a list of supported encodings.

While I believe this is impractical, there could be a link to
https://docs.python.org/3/library/codecs.html#standard-encodings
-- and possible subsubsections that follow.  Are the latter supported for Python code?
msg246459 - (view) Author: Sameer Kulkarni (ksameersrk) * Date: 2015-07-08 16:00
I have added link to Standard Encodings : https://docs.python.org/3/library/codecs.html#standard-encodings
and Python Specific Encodings : https://docs.python.org/3/library/codecs.html#python-specific-encodings
msg246880 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-07-18 03:51
You can remove the “.. XXX” line; I understand it is just like a TODO comment, and with this fixed it would no longer be relevant. I suggest putting the links next to the sentence that ends “. . . the encoding name must be recognized by Python.”

The links should be internal links, rather than hard-coded Internet links to another version of the documentation. See <https://docs.python.org/devguide/documenting.html#cross-linking-markup>. The Standard Encodings section already has a label already set up for you to use :)
msg246884 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-07-18 04:23
PEP 263 doesn’t say exactly what encodings are supported. It mentions Shift JIS is supported, but UTF-16 is not. Only UTF-8 is allowed if the file starts with a UTF-8 BOM. I guess many of the Python-specific text encodings from the second section may be supported. Probably any text encoding in general, as long as the first one or two lines can “rougly” be parsed in ASCII.
msg416604 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2022-04-02 23:42
I am writing a PR with an internal link.  I decided that linking to Standard Encodings is sufficient.  The Python Text Encodings section follows that. Anyone wanting to use any of those can experiment to see which work.
msg416605 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2022-04-03 00:13
New changeset 01be5d6446abbdd95d0c18bd19a58a62b05568d8 by Terry Jan Reedy in branch 'main':
bpo-24563: Link encoding names to encoding declarations (GH-32274)
https://github.com/python/cpython/commit/01be5d6446abbdd95d0c18bd19a58a62b05568d8
msg416606 - (view) Author: miss-islington (miss-islington) Date: 2022-04-03 00:40
New changeset f4e280d8c5461fa5e928fa07f6cd1779a4ac43ba by Miss Islington (bot) in branch '3.9':
bpo-24563: Link encoding names to encoding declarations (GH-32274)
https://github.com/python/cpython/commit/f4e280d8c5461fa5e928fa07f6cd1779a4ac43ba
msg416607 - (view) Author: miss-islington (miss-islington) Date: 2022-04-03 00:40
New changeset ce6af314ca8529d5ed0f307deb9c33029a69f4cb by Miss Islington (bot) in branch '3.10':
bpo-24563: Link encoding names to encoding declarations (GH-32274)
https://github.com/python/cpython/commit/ce6af314ca8529d5ed0f307deb9c33029a69f4cb
History
Date User Action Args
2022-04-11 14:58:18adminsetgithub: 68751
2022-04-03 00:41:31terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-04-03 00:40:59miss-islingtonsetmessages: + msg416607
2022-04-03 00:40:39miss-islingtonsetmessages: + msg416606
2022-04-03 00:13:51miss-islingtonsetpull_requests: + pull_request30339
2022-04-03 00:13:47miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request30338
2022-04-03 00:13:45terry.reedysetmessages: + msg416605
2022-04-02 23:54:21terry.reedysetpull_requests: + pull_request30337
2022-04-02 23:42:43terry.reedysetmessages: + msg416604
2022-04-02 17:28:36iritkatrielsetkeywords: + easy
title: Encoding declaration: doc supported encodings -> [doc] Encoding declaration: doc supported encodings
versions: + Python 3.9, Python 3.10, Python 3.11, - Python 2.7, Python 3.4, Python 3.5, Python 3.6
2015-07-18 04:23:21martin.pantersetmessages: + msg246884
2015-07-18 03:51:46martin.pantersetnosy: + martin.panter

messages: + msg246880
stage: needs patch -> patch review
2015-07-08 16:00:36ksameersrksetfiles: + encoding_links.patch

nosy: + ksameersrk
messages: + msg246459

keywords: + patch
2015-07-03 23:38:39terry.reedycreate