Two UTF-8 decoders are specified:
From the WHATWG algorythm, the rules
- Set UTF-8 lower boundary to 0x80 and UTF-8 upper boundary to 0xBF.
- Set UTF-8 code point to (UTF-8 code point << 6) | (byte & 0x3F)
are not used in Wasm.
My understanding is that U+DC01 and U+FFFD should be equal in the JS API, as tested here
|
assert_sections(WebAssembly.Module.customSections(module, "na\uFFFDme"), [ |
|
bytes, |
|
]); |
|
assert_sections(WebAssembly.Module.customSections(module, "na\uDC01me"), [ |
|
bytes, |
While in Wasm they would be considered as two different sections, which could cause sublte mismatchs.
Note that this is the only occurence of UTF-8 decoding in the JS spec.
Two UTF-8 decoders are specified:
WebAssembly.Module.customSections's name decoding (defined in the WHATWG): https://encoding.spec.whatwg.org/#utf-8.From the WHATWG algorythm, the rules
are not used in Wasm.
My understanding is that
U+DC01andU+FFFDshould be equal in the JS API, as tested herespec/test/js-api/module/customSections.any.js
Lines 156 to 160 in 5aaea96
Note that this is the only occurence of UTF-8 decoding in the JS spec.