Compliance cases

These are the 7,246 inputs a submission must answer. A conforming implementation returns true for the 2,791 valid ones and false for the 4,455 invalid ones. You can run the suite without reading it, or open any case to see its input and where its first ill-formed byte is.

Well-formed means Table 3-7 of the Unicode Standard, as RFC 3629 restates it: no overlong forms, surrogates, code points above U+10FFFF, stray continuation bytes or sequences cut short. The compliance suite combines Markus Kuhn's UTF-8 stress test, WPT's fatal TextDecoder tests, every lead byte against the edges of its allowed ranges, errors at every offset around 16-, 32- and 64-byte blocks and at the end of every length up to 130 bytes, large inputs, and seeded random text. simdutf, Python and a Table 3-7 reference agree on every answer.

Run the full compliance suite locally. Replace your-component.wasm with your compiled component. Download the suite

curl -fLo validate_utf8.comply.wasm https://calculated.world/comply/validate_utf8.wasm
npx qipok your-component.wasm --suite validate_utf8.comply.wasm
Clear

21 of 7,246 cases · 1 true · 20 false

Case Name Expected Note Size
000080 wpt/ends early 2 Web Platform Tests false WPT: TextDecoder with fatal: true must throw (ends early 2). 1 B
000081 wpt/invalid trail Web Platform Tests false WPT: TextDecoder with fatal: true must throw (invalid trail). 2 B
000082 wpt/invalid trail 2 Web Platform Tests false WPT: TextDecoder with fatal: true must throw (invalid trail 2). 2 B
000083 wpt/invalid trail 3 Web Platform Tests false WPT: TextDecoder with fatal: true must throw (invalid trail 3). 2 B
000084 wpt/invalid trail 4 Web Platform Tests false WPT: TextDecoder with fatal: true must throw (invalid trail 4). 2 B
000085 wpt/invalid trail 5 Web Platform Tests false WPT: TextDecoder with fatal: true must throw (invalid trail 5). 3 B
000086 wpt/invalid trail 6 Web Platform Tests false WPT: TextDecoder with fatal: true must throw (invalid trail 6). 3 B
000087 wpt/obsolete lead byte Web Platform Tests false WPT: TextDecoder with fatal: true must throw (obsolete lead byte). 6 B
000088 wpt/overlong U+007F - 3 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+007F - 3 bytes). 3 B
000089 wpt/overlong U+007F - 4 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+007F - 4 bytes). 4 B
000090 wpt/overlong U+007F - 5 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+007F - 5 bytes). 5 B
000091 wpt/overlong U+007F - 6 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+007F - 6 bytes). 6 B
000092 wpt/overlong U+07FF - 4 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+07FF - 4 bytes). 4 B
000093 wpt/overlong U+07FF - 5 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+07FF - 5 bytes). 5 B
000094 wpt/overlong U+07FF - 6 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+07FF - 6 bytes). 6 B
000095 wpt/overlong U+FFFF - 5 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+FFFF - 5 bytes). 5 B
000096 wpt/overlong U+FFFF - 6 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+FFFF - 6 bytes). 6 B
000097 wpt/overlong U+10FFFF - 5 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+10FFFF - 5 bytes). 5 B
000098 wpt/overlong U+10FFFF - 6 bytes Web Platform Tests false WPT: TextDecoder with fatal: true must throw (overlong U+10FFFF - 6 bytes). 6 B
000099 wpt/full sequence Web Platform Tests true WPT: ♥ decodes with fatal: true. 3 B
000100 wpt/incomplete sequence Web Platform Tests false WPT: the first two bytes of ♥ throw with fatal: true. 2 B

Where these rules come from

Well-formed UTF-8 is defined by Table 3-7 of the Unicode Standard, chapter 3 , which RFC 3629 restates as ABNF. Every answer is agreed by simdutf 9.4.0, Python’s strict codec and a direct reading of the table; the suite’s own tests add Node.js’s buffer.isUtf8 and a fatal TextDecoder.