mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Normalize the encoding names for Latin-1 and UTF-8 to
'latin-1' and 'utf-8'. These are optimized in the Python Unicode implementation to result in more direct processing, bypassing the codec registry. Also see issue11303.
This commit is contained in:
parent
a391b11320
commit
8f36af7a4c
32 changed files with 84 additions and 79 deletions
|
|
@ -707,7 +707,7 @@ class StrTest(unittest.TestCase, BaseStrTest):
|
|||
class BytesTest(unittest.TestCase, BaseStrTest):
|
||||
|
||||
def from_latin1(self, s):
|
||||
return s.encode("latin1")
|
||||
return s.encode("latin-1")
|
||||
|
||||
@bigmemtest(minsize=_2G + 2, memuse=1 + character_size)
|
||||
def test_decode(self, size):
|
||||
|
|
@ -718,7 +718,7 @@ class BytesTest(unittest.TestCase, BaseStrTest):
|
|||
class BytearrayTest(unittest.TestCase, BaseStrTest):
|
||||
|
||||
def from_latin1(self, s):
|
||||
return bytearray(s.encode("latin1"))
|
||||
return bytearray(s.encode("latin-1"))
|
||||
|
||||
@bigmemtest(minsize=_2G + 2, memuse=1 + character_size)
|
||||
def test_decode(self, size):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue