From 92873c8a166119eff762ac1cf1481b282fbb4797 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 5 Jun 2026 10:58:20 +0300 Subject: [PATCH] gh-62825: Fix encoding aliases "KS_C_5601-1987", "KS X 1001", etc (GH-150933) They are now aliases of CP949 instead of EUC-KR. (cherry picked from commit 45562c6f4f469e278a9c03c31c2cdadf8100d101) Co-authored-by: Serhiy Storchaka --- Lib/encodings/aliases.py | 12 ++++++------ .../2026-06-04-23-10-31.gh-issue-62825.BtG_yQ.rst | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2026-06-04-23-10-31.gh-issue-62825.BtG_yQ.rst diff --git a/Lib/encodings/aliases.py b/Lib/encodings/aliases.py index e5e50630f33d14..df4c230fbf9c4e 100644 --- a/Lib/encodings/aliases.py +++ b/Lib/encodings/aliases.py @@ -226,6 +226,12 @@ # cp949 codec '949' : 'cp949', + 'korean' : 'cp949', + 'ksc5601' : 'cp949', + 'ks_c_5601' : 'cp949', + 'ks_c_5601_1987' : 'cp949', + 'ksx1001' : 'cp949', + 'ks_x_1001' : 'cp949', 'ms949' : 'cp949', 'uhc' : 'cp949', @@ -248,12 +254,6 @@ # euc_kr codec 'euckr' : 'euc_kr', - 'korean' : 'euc_kr', - 'ksc5601' : 'euc_kr', - 'ks_c_5601' : 'euc_kr', - 'ks_c_5601_1987' : 'euc_kr', - 'ksx1001' : 'euc_kr', - 'ks_x_1001' : 'euc_kr', 'cseuckr' : 'euc_kr', # gb18030 codec diff --git a/Misc/NEWS.d/next/Library/2026-06-04-23-10-31.gh-issue-62825.BtG_yQ.rst b/Misc/NEWS.d/next/Library/2026-06-04-23-10-31.gh-issue-62825.BtG_yQ.rst new file mode 100644 index 00000000000000..95a4fb1c61d4c3 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-06-04-23-10-31.gh-issue-62825.BtG_yQ.rst @@ -0,0 +1,2 @@ +Encodings "KS_C_5601-1987", "KS X 1001", etc are now aliases of "CP949" +instead of "EUC-KR".