MCPcopy Index your code
hub / github.com/python/cpython / test_multibyte_encoding

Method test_multibyte_encoding

Lib/test/test_codecs.py:3483–3495  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3481 ))
3482
3483 def test_multibyte_encoding(self):
3484 self.check_decode(932, (
3485 (b'\x84\xe9\x80', 'ignore', '\u9a3e'),
3486 (b'\x84\xe9\x80', 'replace', '\ufffd\u9a3e'),
3487 ))
3488 self.check_decode(self.CP_UTF8, (
3489 (b'\xff\xf4\x8f\xbf\xbf', 'ignore', '\U0010ffff'),
3490 (b'\xff\xf4\x8f\xbf\xbf', 'replace', '\ufffd\U0010ffff'),
3491 ))
3492 self.check_encode(self.CP_UTF8, (
3493 ('[\U0010ffff\uDC80]', 'ignore', b'[\xf4\x8f\xbf\xbf]'),
3494 ('[\U0010ffff\uDC80]', 'replace', b'[\xf4\x8f\xbf\xbf?]'),
3495 ))
3496
3497 def test_code_page_decode_flags(self):
3498 # Issue #36312: For some code pages (e.g. UTF-7) flags for

Callers

nothing calls this directly

Calls 2

check_decodeMethod · 0.95
check_encodeMethod · 0.95

Tested by

no test coverage detected