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

All 7,246 cases · 2,791 true · 4,455 false

Case Name Expected Note Size
001800 regression/F4 8F third ED Focused regression false 4 B
001801 regression/F4 8F 80 fourth ED Focused regression false 4 B
001802 regression/F4 8F third EF Focused regression false 4 B
001803 regression/F4 8F 80 fourth EF Focused regression false 4 B
001804 regression/F4 8F third F0 Focused regression false 4 B
001805 regression/F4 8F 80 fourth F0 Focused regression false 4 B
001806 regression/F4 8F third F4 Focused regression false 4 B
001807 regression/F4 8F 80 fourth F4 Focused regression false 4 B
001808 regression/F4 8F third F5 Focused regression false 4 B
001809 regression/F4 8F 80 fourth F5 Focused regression false 4 B
001810 regression/F4 8F third FF Focused regression false 4 B
001811 regression/F4 8F 80 fourth FF Focused regression false 4 B
001812 regression/overlong U+0041 in 2 bytes Focused regression false U+0041 needs 1 byte(s); C1 81 is overlong. 2 B
001813 regression/overlong U+0041 in 3 bytes Focused regression false U+0041 needs 1 byte(s); E0 81 81 is overlong. 3 B
001814 regression/overlong U+0041 in 4 bytes Focused regression false U+0041 needs 1 byte(s); F0 80 81 81 is overlong. 4 B
001815 regression/overlong U+0080 in 3 bytes Focused regression false U+0080 needs 2 byte(s); E0 82 80 is overlong. 3 B
001816 regression/overlong U+0080 in 4 bytes Focused regression false U+0080 needs 2 byte(s); F0 80 82 80 is overlong. 4 B
001817 regression/overlong U+0800 in 4 bytes Focused regression false U+0800 needs 3 byte(s); F0 80 A0 80 is overlong. 4 B
001818 regression/modified UTF-8 NUL Focused regression false Java's modified UTF-8 writes NUL as C0 80. 4 B
001819 regression/overlong slash Focused regression false The classic path-traversal overlong '/'. 6 B
001820 regression/CESU-8 U+1F600 Focused regression false U+1F600 as a CESU-8 surrogate pair; UTF-8 needs F0 9F 98 80. 6 B
001821 regression/surrogate between text Focused regression false 9 B
001822 regression/above U+10FFFF F4 BF BF BF Focused regression false 4 B
001823 regression/above U+10FFFF FE FF Focused regression false 2 B
001824 regression/above U+10FFFF FF FE Focused regression false 2 B
001825 regression/noncharacter U+FDD0 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001826 regression/noncharacter U+FDD1 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001827 regression/noncharacter U+FDD2 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001828 regression/noncharacter U+FDD3 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001829 regression/noncharacter U+FDD4 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001830 regression/noncharacter U+FDD5 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001831 regression/noncharacter U+FDD6 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001832 regression/noncharacter U+FDD7 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001833 regression/noncharacter U+FDD8 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001834 regression/noncharacter U+FDD9 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001835 regression/noncharacter U+FDDA Focused regression true Noncharacters are well-formed UTF-8. 3 B
001836 regression/noncharacter U+FDDB Focused regression true Noncharacters are well-formed UTF-8. 3 B
001837 regression/noncharacter U+FDDC Focused regression true Noncharacters are well-formed UTF-8. 3 B
001838 regression/noncharacter U+FDDD Focused regression true Noncharacters are well-formed UTF-8. 3 B
001839 regression/noncharacter U+FDDE Focused regression true Noncharacters are well-formed UTF-8. 3 B
001840 regression/noncharacter U+FDDF Focused regression true Noncharacters are well-formed UTF-8. 3 B
001841 regression/noncharacter U+FDE0 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001842 regression/noncharacter U+FDE1 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001843 regression/noncharacter U+FDE2 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001844 regression/noncharacter U+FDE3 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001845 regression/noncharacter U+FDE4 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001846 regression/noncharacter U+FDE5 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001847 regression/noncharacter U+FDE6 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001848 regression/noncharacter U+FDE7 Focused regression true Noncharacters are well-formed UTF-8. 3 B
001849 regression/noncharacter U+FDE8 Focused regression true Noncharacters are well-formed UTF-8. 3 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.