Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ad8a1c3

Browse files
Issue #22682: Added support for the kz1048 encoding.
1 parent 0d4df75 commit ad8a1c3

8 files changed

Lines changed: 19 additions & 3 deletions

File tree

Doc/library/codecs.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,10 @@ particular, the following variants typically exist:
11621162
+-----------------+--------------------------------+--------------------------------+
11631163
| koi8_u | | Ukrainian |
11641164
+-----------------+--------------------------------+--------------------------------+
1165+
| kz1048 | kz_1048, strk1048_2002, rk1048 | Kazakh |
1166+
| | | |
1167+
| | | .. versionadded:: 3.5 |
1168+
+-----------------+--------------------------------+--------------------------------+
11651169
| mac_cyrillic | maccyrillic | Bulgarian, Byelorussian, |
11661170
| | | Macedonian, Russian, Serbian |
11671171
+-----------------+--------------------------------+--------------------------------+

Doc/whatsnew/3.5.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ Some smaller changes made to the core Python language are:
231231
* The :option:`-b` option now affects comparisons of :class:`bytes` with
232232
:class:`int`. (Contributed by Serhiy Storchaka in :issue:`23681`)
233233

234+
* New Kazakh :ref:`codec <standard-encodings>` ``kz1048``. (Contributed by
235+
Serhiy Storchaka in :issue:`22682`.)
236+
234237

235238
New Modules
236239
===========

Lib/encodings/aliases.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,11 @@
412412
# koi8_r codec
413413
'cskoi8r' : 'koi8_r',
414414

415+
# kz1048 codec
416+
'kz_1048' : 'kz1048',
417+
'rk1048' : 'kz1048',
418+
'strk1048_2002' : 'kz1048',
419+
415420
# latin_1 codec
416421
#
417422
# Note that the latin_1 codec is implemented internally in C and a

Lib/locale.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ def getpreferredencoding(do_setlocale = True):
700700
'utf_8': 'UTF-8',
701701
'koi8_r': 'KOI8-R',
702702
'koi8_u': 'KOI8-U',
703+
'kz1048': 'RK1048',
703704
'cp1251': 'CP1251',
704705
'cp1255': 'CP1255',
705706
'cp1256': 'CP1256',

Lib/test/test_codecs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,7 @@ def test_basic(self):
18231823
"johab",
18241824
"koi8_r",
18251825
"koi8_u",
1826+
"kz1048",
18261827
"latin_1",
18271828
"mac_cyrillic",
18281829
"mac_greek",

Lib/test/test_unicode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,7 @@ def test_codecs_charmap(self):
20812081
'cp863', 'cp865', 'cp866', 'cp1125',
20822082
'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
20832083
'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6',
2084-
'iso8859_7', 'iso8859_9', 'koi8_r', 'latin_1',
2084+
'iso8859_7', 'iso8859_9', 'koi8_r', 'kz1048', 'latin_1',
20852085
'mac_cyrillic', 'mac_latin2',
20862086

20872087
'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255',
@@ -2116,7 +2116,7 @@ def test_codecs_charmap(self):
21162116
#'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255',
21172117
#'cp1256', 'cp1257', 'cp1258',
21182118
#'cp424', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874',
2119-
#'iso8859_3', 'iso8859_6', 'iso8859_7',
2119+
#'iso8859_3', 'iso8859_6', 'iso8859_7', 'kz1048',
21202120
#'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish',
21212121

21222122
### These fail the round-trip:

Lib/test/test_xml_etree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ def bxml(encoding):
704704
'mac-roman', 'mac-turkish',
705705
'iso2022-jp', 'iso2022-jp-1', 'iso2022-jp-2', 'iso2022-jp-2004',
706706
'iso2022-jp-3', 'iso2022-jp-ext',
707-
'koi8-r', 'koi8-u',
707+
'koi8-r', 'koi8-u', 'kz1048',
708708
'hz', 'ptcp154',
709709
]
710710
for encoding in supported_encodings:

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Core and Builtins
4242
Library
4343
-------
4444

45+
- Issue #22682: Added support for the kz1048 encoding.
46+
4547
- Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
4648
if they called on a closed object. Patch by John Hergenroeder.
4749

0 commit comments

Comments
 (0)