Found when porting encoding WPT into core.
Spec: https://encoding.spec.whatwg.org/#concept-td-serialize
If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore BOM flag and BOM seen flag are unset, then:
- If token is U+FEFF, then set BOM seen flag.
- Otherwise, if token is not end-of-stream, then set BOM seen flag and append token to output.
- Otherwise, return output.
Failing tests:
cc @nodejs/i18n
Sorry, pinged the wrong team @nodejs/intl
PR merged, should be close.
PR was merged, but the bug still exists. Both failing tests are skipped: https://github.com/nodejs/node/blob/7c9ee6dd88cc2908a3db70eba9c15eddd1112c50/test/wpt/status/encoding.json#L24-L29
Most helpful comment
PR was merged, but the bug still exists. Both failing tests are skipped: https://github.com/nodejs/node/blob/7c9ee6dd88cc2908a3db70eba9c15eddd1112c50/test/wpt/status/encoding.json#L24-L29