mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Issue #13916: Fix surrogatepass error handler on Windows
This commit is contained in:
parent
b96ebd4f9d
commit
0d4e01ca07
2 changed files with 4 additions and 6 deletions
|
@ -2841,12 +2841,6 @@ class CodePageTest(unittest.TestCase):
|
||||||
(b'abc', 'strict', 'abc'),
|
(b'abc', 'strict', 'abc'),
|
||||||
(b'\xe9\x80', 'strict', '\xe9\u20ac'),
|
(b'\xe9\x80', 'strict', '\xe9\u20ac'),
|
||||||
(b'\xff', 'strict', '\xff'),
|
(b'\xff', 'strict', '\xff'),
|
||||||
# invalid bytes
|
|
||||||
(b'[\x98]', 'strict', None),
|
|
||||||
(b'[\x98]', 'ignore', '[]'),
|
|
||||||
(b'[\x98]', 'replace', '[\ufffd]'),
|
|
||||||
(b'[\x98]', 'surrogateescape', '[\udc98]'),
|
|
||||||
(b'[\x98]', 'surrogatepass', None),
|
|
||||||
))
|
))
|
||||||
|
|
||||||
def test_cp_utf7(self):
|
def test_cp_utf7(self):
|
||||||
|
|
|
@ -960,6 +960,10 @@ get_standard_encoding(const char *encoding, int *bytelength)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (strcmp(encoding, "CP_UTF8") == 0) {
|
||||||
|
*bytelength = 3;
|
||||||
|
return ENC_UTF8;
|
||||||
|
}
|
||||||
return ENC_UNKNOWN;
|
return ENC_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue