fix-utf16-response-test-on-big-endian-systems (#7508)

This commit is contained in:
Fat-Coder-CN 2026-07-01 15:16:01 +08:00 committed by GitHub
parent 361f689df7
commit 870803b7fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -163,12 +163,13 @@ class TestTextResponse(TestResponse):
def test_utf16(self):
"""Test utf-16 because UnicodeDammit is known to have problems with"""
body = b"\xff\xfeh\x00i\x00"
r = self.response_class(
"http://www.example.com",
body=b"\xff\xfeh\x00i\x00",
body=body,
encoding="utf-16",
)
self._assert_response_values(r, "utf-16", "hi")
self._assert_response_values(r, "utf-16", body)
def test_invalid_utf8_encoded_body_with_valid_utf8_BOM(self):
r6 = self.response_class(