fix(native): preserve leading U+FEFF in Apple metadata names (#4730)

* fix(native): preserve leading U+FEFF in Apple metadata names

* test(native): run property metadata regressions on macOS
This commit is contained in:
ShuaixinHuang authored and GitHub committed 2026-10-17 23:23:27 +08:00
1 parent af67ad5047
commit 68c3c5b538
5 files changed
+143 -1

No files matched your search

+2 -1
View File
@@ -87,7 +87,8 @@ export const decodeAppleDispatchMetadata = (
if (end === bytes.length || end - start >= 4096)
throw new RangeError("Unterminated or oversized metadata string");
offset(address, end - start + 1);
return new TextDecoder("utf-8", { fatal: true }).decode(
// A metadata C string owns every code point, including an initial U+FEFF.
return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(
bytes.subarray(start, end),
);
};