This issue tracker will soon become read-only and move to GitHub.
For a smoother transition, remember to log in and link your GitHub username to your profile.
For more information, see this post about the migration.

classification
Title: Encoding declaration: doc supported encodings
Type: enhancement Stage: patch review
Components: Documentation Versions: Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ksameersrk, martin.panter, terry.reedy
Priority: normal Keywords: patch

Created on 2015-07-03 23:38 by terry.reedy, last changed 2015-07-18 04:23 by martin.panter.

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
Messages (4)
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.
History
Date User Action Args
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