FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-62259: Add support of multi-byte encodings in the XML parser by serhiy-storchaka · Pull Request #149860 · python/cpython · GitHub

Repository navigation

gh-62259: Add support of multi-byte encodings in the XML parser - #149860

Merged
serhiy-storchaka merged 5 commits into
python:mainfrom
serhiy-storchaka:pyexpat-multibyte-encodings2
May 26, 2026
Merged

serhiy-storchaka merged 5 commits into
python:mainfrom
serhiy-storchaka:pyexpat-multibyte-encodings2

Conversation

serhiy-storchaka commented May 15, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Supported encodings: "cp932", "cp949", "cp950", "Big5","EUC-JP", "GB2312", "GBK", "johab", and "Shift_JIS".

Partially supported encodings (only BMP characters): "Big5-HKSCS", "EUC_JIS-2004", "EUC_JISX0213", "Shift_JIS-2004", "Shift_JISX0213", "utf-8-sig" and non-standard aliases like "UTF8" (without hyphen).

The parser now raises ValueError for known unsupported multi-byte encodings such us "ISO-2022-JP" or "raw-unicode-escape" instead of failing later, when encounter non-ASCII data.

Supported encodings: "cp932", "cp949", "cp950", "Big5","EUC-JP",
"GB2312", "GBK", "johab", and "Shift_JIS".

Partially supported encodings (only BMP characters): "Big5-HKSCS",
"EUC_JIS-2004", "EUC_JISX0213", "Shift_JIS-2004", "Shift_JISX0213",
"utf-8-sig" and non-standard aliases like "UTF8" (without hyphen).

The parser now raises ValueError for known unsupported
multi-byte encodings such us "ISO-2022-JP" or "raw-unicode-escape"
instead of failing later, when encounter non-ASCII data.

read-the-docs-community Bot commented May 15, 2026 •
edited
Loading

Copy link
Copy Markdown

malemburg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.

The only detail that is missing is the documentation update. This still reads "UTF-8, UTF-16, ISO-8859-1 (Latin1), and ASCII" which already appears to be out of date.

Comment thread Doc/library/pyexpat.rst Outdated
Comment thread Doc/library/pyexpat.rst Outdated
*encoding* [1]_ is given it will override the implicit or explicit encoding of the
document.
must be a string naming the encoding used by the XML data.
Expat natively understands and processes UTF-8, UTF-16, UTF-16BE, UTF-16LE,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this should be an .. impl-detail (I don't remember the exact name)?

Comment thread Doc/whatsnew/3.16.rst Outdated
serhiy-storchaka enabled auto-merge (squash) May 26, 2026 19:16
serhiy-storchaka merged commit 8ab7b43 into python:main May 26, 2026
56 checks passed
serhiy-storchaka deleted the pyexpat-multibyte-encodings2 branch May 30, 2026 10:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL