dns: the rest of UTS #46 - mapping table, NFC, CONTEXTJ/CONTEXTO and Bidi (DNS.md slice 9) #365
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
DNS.md slice 9: "the rest of UTS #46: the mapping table, NFC, the combining-mark, CONTEXTJ, CONTEXTO and Bidi rules". Today
DomainName.tryFromlower-cases withChar.toLowerCaseand refuses what it cannot check; the table in section 3 ("What is not covered, exactly") says each row is "closed when [the table] does". This issue closes all of them. Last of the chain of #36.Depends on
String.toNfc) merged, andNot
readybefore both.Decisions (refinement)
UseSTD3ASCIIRules=true,CheckHyphens=false; now alsoCheckBidi=trueandCheckJoiners=true,VerifyDnsLength=true. The section is rewritten to the as-built state; the "What is not covered" table is deleted and its rows move into the as-built text.ß ςkept, ZWJ/ZWNJ kept for CONTEXTJ), normalize to NFC, break at the dots, convert/validate each label (status check against the table, no combining mark first, hyphen rules as now, CONTEXTJ, CONTEXTO, Bidi rule per RFC 5893 on a domain that has a right-to-left label), Punycode, lengths.DnsError.InvalidNameand a reason that names the code point (U+XXXX); upper-case non-Latin names are mapped (ПРИМЕР.рфbecomesxn--e1afmkfd.xn--p1ai).DomainName.ofPresentationandofLabelsare untouched.refusalinstd/dns/src/name.trb; no newDnsErrorcase (theDnsErrornewtype question of RELEASE.md section 2 stays separate).mappedPoint/isIgnored/refusalranges are deleted, not kept as a fallback.Acceptance criteria
DomainName.tryFromimplements the steps above on top ofString.toNfc()and the private natives of the IDNA issue;std/dns/src/name.trbloses the hand-written ranges.IdnaTestV2.txtof the pinned version passes in full for the to-ASCII column with the settings above (cases the file marks as errors are refused, others give the expected A-labels): a std test runs a committed excerpt of at least 400 lines chosen to cover every status, every error class the file uses and each CONTEXTO rule; the whole file runs in CI aftertools/fetch-unicode.sh.std/dns/tests/names.test.trb: the Cyrillic and Greek upper-case names,bu+ U+0308 equal tobü, a leading combining mark refused,ß/ςkept, a Persian name that needs ZWNJ accepted and a stray ZWNJ refused, the middle dot rule (l·laccepted,a·brefused), Hebrew geresh, Katakana middle dot, a mixed Arabic/Latin label refused by the Bidi rule, an A-label whose decoding would map differently refused, every length limit as before. All existing tests keep passing or change with a stated reason.docs/design/DNS.mdsection 3 and slice 9 ("done"),docs/standard-library/dns.md, the doc comment ofDomainName.tryFrom,docs/design/URI.mdwhere it quotes the limitation; one paragraph indocs/PERFORMANCE.mdthat states the Unicode version and the measured size of all tables together in a native hello-world binary and in a program that uses every table (the old "size measured and stated" criterion of this work);torb docs skill docs skillsregenerated.std/uri,std/http) still pass.Seed impact
None new: no syntax, no new native (the previous issues made them known), no driver flag;
std/dnsnames are not looked up by string. Nothing underseed/.Size
One PR, two Conventional Commits:
feat(dns): UTS #46 mapping, NFC, validity and the combining-mark ruleandfeat(dns): CONTEXTJ, CONTEXTO and the Bidi rule. If the diff of the first commit passes ~1500 changed lines excluding tests, the implementer splits the second commit into its own issue (labelloop, depends on the first) and says so in the result comment.[loop:torbscript] refine: body written by the refinement of #36. next: waiting (depends on #363 and on #364 merged and in a published seed)