MCPcopy
hub / github.com/rspeer/python-ftfy / Codec

Class Codec

ftfy/bad_codecs/sloppy.py:122–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 # `encodings.cp1252` for comparison; this is almost exactly the same,
121 # except I made it follow pep8.
122 class Codec(codecs.Codec):
123 def encode(self, input: str, errors: str | None = "strict") -> tuple[bytes, int]:
124 return codecs.charmap_encode(input, errors, encoding_table)
125
126 def decode(self, input: bytes, errors: str | None = "strict") -> tuple[str, int]:
127 return codecs.charmap_decode(input, errors, decoding_table) # type: ignore[arg-type]
128
129 class IncrementalEncoder(codecs.IncrementalEncoder):
130 def encode(self, input: str, final: bool = False) -> bytes:

Callers 1

make_sloppy_codecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected