mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-48181: Document codecs.charmap_build
(#135997)
This commit is contained in:
parent
75f40595e5
commit
2bdd50309f
1 changed files with 8 additions and 0 deletions
|
@ -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, /)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue