Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Open
Description
Bug report
Bug description:
b"ab".decode("UTF-16")
Onhttps://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G28070, UTF-16 is not pointing at endian (there is no BOM and in the absence of higher-level protocol), UTF-16 is big-endian.
The UTF-16 encoding scheme may or may not begin with a BOM. However, when there is no BOM, and in the absence of a higher-level protocol, the byte order of the UTF-16 encoding scheme is big-endian.
However, CPython actual behavior is maybe depends on CPU architecture.
I tested x86_64(WSL Ubuntu), and aarch64(Raspberry Pi(Raspbian) and macOS).
x86_64 result is慢
(U+6162), aarch64 result is扡
(U+6261).
I think endian is big-endian inUTF-16
.
CPython versions tested on:
3.10, 3.12
Operating systems tested on:
Linux, macOS
Metadata
Metadata
Assignees
Projects
Status
Todo