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

Method encode

ftfy/bad_codecs/sloppy.py:123–124  ·  view source on GitHub ↗
(self, input: str, errors: str | None = "strict")

Source from the content-addressed store, hash-verified

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]

Callers 8

apply_planFunction · 0.45
explain_unicodeFunction · 0.45
replace_lossy_sequencesFunction · 0.45
_c1_fixerFunction · 0.45
show_char_tableFunction · 0.45
test_json_exampleFunction · 0.45
test_guess_bytesFunction · 0.45

Calls

no outgoing calls

Tested by 2

test_json_exampleFunction · 0.36
test_guess_bytesFunction · 0.36