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
1,299 of 7,246 cases · 408 true · 891 false
| Case | Name | Expected | Note | Size |
|---|---|---|---|---|
| 002390 | regression/U+10FFFF at 81 in ASCII Focused regression | true | 128 B | |
| 002391 | regression/U+10FFFF at 92 in ASCII Focused regression | true | 128 B | |
| 002392 | regression/U+10FFFF at 93 in ASCII Focused regression | true | 128 B | |
| 002393 | regression/U+10FFFF at 94 in ASCII Focused regression | true | 128 B | |
| 002394 | regression/U+10FFFF at 95 in ASCII Focused regression | true | 128 B | |
| 002395 | regression/U+10FFFF at 96 in ASCII Focused regression | true | 128 B | |
| 002396 | regression/U+10FFFF at 97 in ASCII Focused regression | true | 128 B | |
| 002397 | regression/U+10FFFF at 108 in ASCII Focused regression | true | 128 B | |
| 002398 | regression/U+10FFFF at 109 in ASCII Focused regression | true | 128 B | |
| 002399 | regression/U+10FFFF at 110 in ASCII Focused regression | true | 128 B | |
| 002400 | regression/U+10FFFF at 111 in ASCII Focused regression | true | 128 B | |
| 002401 | regression/U+10FFFF at 112 in ASCII Focused regression | true | 128 B | |
| 002402 | regression/U+10FFFF at 113 in ASCII Focused regression | true | 128 B | |
| 002403 | regression/U+10FFFF at 124 in ASCII Focused regression | true | 128 B | |
| 003388 | regression/U+10000 at 0 in mixed Focused regression | true | 128 B | |
| 003389 | regression/U+10000 at 1 in mixed Focused regression | true | 128 B | |
| 003390 | regression/U+10000 at 12 in mixed Focused regression | true | 128 B | |
| 003391 | regression/U+10000 at 13 in mixed Focused regression | true | 128 B | |
| 003392 | regression/U+10000 at 15 in mixed Focused regression | true | 128 B | |
| 003393 | regression/U+10000 at 16 in mixed Focused regression | true | 128 B | |
| 003394 | regression/U+10000 at 17 in mixed Focused regression | true | 128 B | |
| 003395 | regression/U+10000 at 28 in mixed Focused regression | true | 128 B | |
| 003396 | regression/U+10000 at 29 in mixed Focused regression | true | 128 B | |
| 003397 | regression/U+10000 at 32 in mixed Focused regression | true | 128 B | |
| 003398 | regression/U+10000 at 36 in mixed Focused regression | true | 128 B | |
| 003399 | regression/U+10000 at 44 in mixed Focused regression | true | 128 B | |
| 003400 | regression/U+10000 at 48 in mixed Focused regression | true | 128 B | |
| 003401 | regression/U+10000 at 49 in mixed Focused regression | true | 128 B | |
| 003402 | regression/U+10000 at 60 in mixed Focused regression | true | 128 B | |
| 003403 | regression/U+10000 at 61 in mixed Focused regression | true | 128 B | |
| 003404 | regression/U+10000 at 63 in mixed Focused regression | true | 128 B | |
| 003405 | regression/U+10000 at 64 in mixed Focused regression | true | 128 B | |
| 003406 | regression/U+10000 at 65 in mixed Focused regression | true | 128 B | |
| 003407 | regression/U+10000 at 76 in mixed Focused regression | true | 128 B | |
| 003408 | regression/U+10000 at 77 in mixed Focused regression | true | 128 B | |
| 003409 | regression/U+10000 at 80 in mixed Focused regression | true | 128 B | |
| 003410 | regression/U+10000 at 84 in mixed Focused regression | true | 128 B | |
| 003411 | regression/U+10000 at 92 in mixed Focused regression | true | 128 B | |
| 003412 | regression/U+10000 at 96 in mixed Focused regression | true | 128 B | |
| 003413 | regression/U+10000 at 97 in mixed Focused regression | true | 128 B | |
| 003414 | regression/U+10000 at 108 in mixed Focused regression | true | 128 B | |
| 003415 | regression/U+10000 at 109 in mixed Focused regression | true | 128 B | |
| 003416 | regression/U+10000 at 111 in mixed Focused regression | true | 128 B | |
| 003417 | regression/U+10000 at 112 in mixed Focused regression | true | 128 B | |
| 003418 | regression/U+10000 at 113 in mixed Focused regression | true | 128 B | |
| 003419 | regression/U+10000 at 124 in mixed Focused regression | true | 128 B | |
| 003420 | regression/U+1F600 at 0 in mixed Focused regression | true | 128 B | |
| 003421 | regression/U+1F600 at 1 in mixed Focused regression | true | 128 B | |
| 003422 | regression/U+1F600 at 12 in mixed Focused regression | true | 128 B | |
| 003423 | regression/U+1F600 at 13 in mixed Focused regression | true | 128 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.
- UTF-8 decoder capability and stress test — Markus Kuhn’s file, the source of the 80 Kuhn cases
-
WPT textdecoder-fatal tests
— what browsers must reject when decoding with
fatal: true - Validating UTF-8 In Less Than One Instruction Per Byte — John Keiser and Daniel Lemire’s vectorised algorithm, which simdutf uses