Commit 863e457
committed
lib: fix big5 table decoding on big-endian platforms
test/parallel/test-whatwg-encoding-big5 failed on AIX and LinuxONE
(both big-endian) in CI: `new Uint32Array(buf.buffer, ...)` reinterprets
the table's bytes using the host's native byte order, but the table is
serialized as little-endian. On a big-endian host this silently turns
valid entries into out-of-range values (e.g. U+4E00 stored as bytes
00 4E 00 00 was read back as 0x004E0000, well past the U+10FFFF limit),
which then made StringFromCodePoint() throw RangeError.
Read each 32-bit entry explicitly as little-endian via DataView instead,
which is well-defined regardless of host byte order.
Fixes the AIX/LinuxONE failures reported on #65458 by
richardlau.
Signed-off-by: agape1225 <49804691+agape1225@users.noreply.github.com>1 parent 9a13607 commit 863e457
1 file changed
Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments