8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
codecs.charmap_build
1 parent 75f4059 commit 2bdd503Copy full SHA for 2bdd503
Doc/library/codecs.rst
@@ -53,6 +53,14 @@ any codec:
53
:exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more
54
information on codec error handling.
55
56
+.. function:: charmap_build(string)
57
+
58
+ Return a mapping suitable for encoding with a custom single-byte encoding.
59
+ Given a :class:`str` *string* of up to 256 characters representing a
60
+ decoding table, returns either a compact internal mapping object
61
+ ``EncodingMap`` or a :class:`dictionary <dict>` mapping character ordinals
62
+ to byte values. Raises a :exc:`TypeError` on invalid input.
63
64
The full details for each codec can also be looked up directly:
65
66
.. function:: lookup(encoding, /)
0 commit comments