Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/codecs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ particular, the following variants typically exist:
| | | |
| | | .. versionadded:: 3.5 |
+-----------------+--------------------------------+--------------------------------+
| mac_cyrillic | maccyrillic | Belarusian, Bulgarian, |
| mac_cyrillic | maccyrillic, x-mac-cyrillic | Belarusian, Bulgarian, |
| | | Macedonian, Russian, Serbian |
+-----------------+--------------------------------+--------------------------------+
| mac_greek | macgreek | Greek |
Expand Down
1 change: 1 addition & 0 deletions Lib/encodings/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@

# mac_cyrillic codec
'maccyrillic' : 'mac_cyrillic',
'x_mac_cyrillic' : 'mac_cyrillic',

# mac_greek codec
'macgreek' : 'mac_greek',
Expand Down
9 changes: 9 additions & 0 deletions Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2247,6 +2247,15 @@ def test_basic(self):


class BasicUnicodeTest(unittest.TestCase, MixInCheckStateHandling):
def test_html5_aliases(self):
for alias, encoding in (
('windows-874', 'cp874'),
('x-mac-cyrillic', 'mac_cyrillic'),
):
with self.subTest(alias=alias):
self.assertEqual(codecs.lookup(alias).name,
codecs.lookup(encoding).name)

def test_basics(self):
s = "abc123" # all codecs should be able to encode these
for encoding in all_unicode_encodings:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``x-mac-cyrillic`` as an alias for the ``mac_cyrillic`` codec.
Loading