mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
Port code page codec to Unicode API.
This commit is contained in:
parent
8ba79306d1
commit
3d325191bf
2 changed files with 73 additions and 62 deletions
|
@ -577,22 +577,18 @@ class CodecCallbackTest(unittest.TestCase):
|
|||
UnicodeEncodeError("ascii", "\uffff", 0, 1, "ouch")),
|
||||
("\\uffff", 1)
|
||||
)
|
||||
if SIZEOF_WCHAR_T == 2:
|
||||
len_wide = 2
|
||||
else:
|
||||
len_wide = 1
|
||||
if SIZEOF_WCHAR_T > 0:
|
||||
self.assertEqual(
|
||||
codecs.backslashreplace_errors(
|
||||
UnicodeEncodeError("ascii", "\U00010000",
|
||||
0, len_wide, "ouch")),
|
||||
("\\U00010000", len_wide)
|
||||
0, 1, "ouch")),
|
||||
("\\U00010000", 1)
|
||||
)
|
||||
self.assertEqual(
|
||||
codecs.backslashreplace_errors(
|
||||
UnicodeEncodeError("ascii", "\U0010ffff",
|
||||
0, len_wide, "ouch")),
|
||||
("\\U0010ffff", len_wide)
|
||||
0, 1, "ouch")),
|
||||
("\\U0010ffff", 1)
|
||||
)
|
||||
# Lone surrogates (regardless of unicode width)
|
||||
self.assertEqual(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue