The IDNA tables are generated Pascal constants at the Unicode version of the other Unicode data
Date: 2026-11-29
Area: url, unicode, generated-data
Related: #1822, Build System — Generated Unicode Data
Context
The WHATWG URL Standard's host parser (§3.5) turns a domain with a non-ASCII code point into its ASCII form through
domain to ASCII (§3.3), which is UTS #46 ToASCII. ToASCII needs data the engine did not carry: the IDNA Mapping
Table (UTS #46 §5: each code point's status, and what a mapped one maps to), and, for its validity criteria,
General_Category=Mark, Bidi_Class (CheckBidi, RFC 5893 §2) and Joining_Type (CheckJoiners, RFC 5892 Appendix A).
Its NFC step and the Canonical_Combining_Class=Virama test already have data in
Generated.UnicodeNormalizationData.
The engine already holds Unicode data in two forms. RegExp's property tables are a resource
(Generated.UnicodeData.res) behind an ICU-first lookup, and can be left out of a build. Casing and normalization
are Pascal constant tables (Generated.UnicodeCaseData, Generated.UnicodeNormalizationData) that every build
links, generated from one Unicode version (17.0.0). ICU offers UTS #46 (uidna_nameToASCII), but the engine does
not require ICU, and its answer would follow the system's ICU version.
Decision
- The IDNA data is a generated Pascal constant unit,
Generated.IDNAData, produced byscripts/generate-idna-data.jsfrom Unicode's own files, as the casing and normalization units are. It holds the mapping table as ranges, a range of code points sharing a status and either one mapping or one offset from each code point to its mapping, a pool of the mappings' UTF-16 code units, and one byte of properties for each range of valid code points. Under Nontransitional_Processing a deviation code point is valid, so deviation mappings are not kept. - Its Unicode version is the one the other Unicode units use (17.0.0), so mapping, NFC and the property tests agree. Moving to a new version regenerates them together.
- UTS #46 processing is engine code (
source/units/Goccia.URL.IDNA.pas), not ICU, so every build and platform answers the same. The generated unit holds only the tables and their layout constants; the lookups that read them are inGoccia.URL.IDNA. Its Punycode and ContextJ loops, whose work grows with the square of a label's length, poll the run's limits (CheckNativeWork). - The HTTP client's own parse skips UTS #46.
NormalizeHTTPRequestURLandResolveHTTPRedirectURLkeep a non-ASCII domain as written, percent-encoded or not, so the client's refusal of a non-ASCII host and thenetchecks judge the name the script wrote, as ADR 0149 decided.
Consequences
GocciaRunner --prodgrows by the tables: 6,109 mapping ranges, 2,669 mapping code units and 1,112 property ranges. They are linked constants, so start-up does no work for them.- The web-platform-tests IDNA cases run as a generated suite (
tests/built-ins/URL/wpt-idna.js); a case that expects success through a code point Unicode 17.0.0 does not assign is left out until the version moves.