3 from typing import Any, Callable, Dict, Tuple, Union
5 # This type is not exposed; it is defined in unicodeobject.c
7 def size(self) -> int: ...
9 _MapT = Union[Dict[int, int], _EncodingMap]
10 _Handler = Callable[[Exception], Tuple[str, int]]
12 def register(__search_function: Callable[[str], Any]) -> None: ...
13 def register_error(__errors: str, __handler: _Handler) -> None: ...
14 def lookup(__encoding: str) -> codecs.CodecInfo: ...
15 def lookup_error(__name: str) -> _Handler: ...
16 def decode(obj: Any, encoding: str = ..., errors: str | None = ...) -> Any: ...
17 def encode(obj: Any, encoding: str = ..., errors: str | None = ...) -> Any: ...
18 def charmap_build(__map: str) -> _MapT: ...
19 def ascii_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ...
20 def ascii_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
21 def charmap_decode(__data: bytes, __errors: str | None = ..., __mapping: _MapT | None = ...) -> tuple[str, int]: ...
22 def charmap_encode(__str: str, __errors: str | None = ..., __mapping: _MapT | None = ...) -> tuple[bytes, int]: ...
23 def escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
24 def escape_encode(__data: bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
25 def latin_1_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ...
26 def latin_1_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
27 def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
28 def raw_unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
29 def readbuffer_encode(__data: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
30 def unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
31 def unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
33 if sys.version_info < (3, 8):
34 def unicode_internal_decode(__obj: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
35 def unicode_internal_encode(__obj: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
37 def utf_16_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
38 def utf_16_be_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
39 def utf_16_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
40 def utf_16_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> tuple[bytes, int]: ...
42 __data: bytes, __errors: str | None = ..., __byteorder: int = ..., __final: int = ...
43 ) -> tuple[str, int, int]: ...
44 def utf_16_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
45 def utf_16_le_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
46 def utf_32_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
47 def utf_32_be_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
48 def utf_32_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
49 def utf_32_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> tuple[bytes, int]: ...
51 __data: bytes, __errors: str | None = ..., __byteorder: int = ..., __final: int = ...
52 ) -> tuple[str, int, int]: ...
53 def utf_32_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
54 def utf_32_le_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
55 def utf_7_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
56 def utf_7_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
57 def utf_8_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
58 def utf_8_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
60 if sys.platform == "win32":
61 def mbcs_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
62 def mbcs_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
63 def code_page_decode(__codepage: int, __data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
64 def code_page_encode(__code_page: int, __str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
65 def oem_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
66 def oem_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...