Skip to content
Merged
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
8 changes: 8 additions & 0 deletions Doc/library/codecs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ any codec:
:exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more
information on codec error handling.

.. function:: charmap_build(string)

Return a mapping suitable for encoding with a custom single-byte encoding.
Given a :class:`str` *string* of up to 256 characters representing a
decoding table, returns either a compact internal mapping object
``EncodingMap`` or a :class:`dictionary <dict>` mapping character ordinals
to byte values. Raises a :exc:`TypeError` on invalid input.

The full details for each codec can also be looked up directly:

.. function:: lookup(encoding, /)
Expand Down
Loading