text: String.toNfc(), toNfd(), toNfkc() and toNfkd() (commit 2 of 2) #363
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
Commit 2 of 2 for normalization (the compiler side is #362).
std/textdeclaresString.toNfc(),toNfd(),toNfkc()andtoNfkd()and the docs and conformance programs that go with them. It closes FIRST-PARTY.md gap 23'sstd/texthalf (SASLprep itself belongs to the SCRAM slice that needs it) and givesstd/dnsthe NFC it needs (DNS.md section 3).Depends on
#362, merged and in a published seed (
seeds.txton theseedsrelease lists a seed at or after the merge commit). Until then this issue is notready.Acceptance criteria
std/text/src/lib.trb:native fn toNfc(): Self,toNfd(),toNfkc(),toNfkd()onStringwith doc comments (# Examples,# Pitfalls: normalization changes bytes, compare normalized texts, NFKC loses distinctions, not a security boundary by itself) in the style of the neighbours.tests/conformance/text-normalization.trb(+.expected,.allocations), identical in the VM and natively: precomposed against decomposedü, Hangul syllables and jamo, a ccc reordering case, a singleton (ΩU+2126), compatibility (fi,①,A,㌀), an ASCII text (storage shared), the empty text, andnf(nf(x)) == nf(x).std/text/tests/) that runs a committed excerpt ofNormalizationTest.txtof the pinned version through all four methods; the whole file stays the runtime test of the previous issue.docs/standard-library/text page,docs/design/FIRST-PARTY.mdgap 23 row marked built for the normalization part,docs/design/DNS.mdslice 9 row text updated ("NFC: built"),docs/ROADMAP.mdline about the natives updated;torb docs skill docs skillsregenerated and committed.Seed impact
No new native here (it is known to the seed), but a std name is added: the declaration is what the previous commit made safe. Nothing under
seed/; no seed refresh needed after this merge.Size
One PR, one Conventional Commit:
feat(text): normalization forms of a String.[loop:torbscript] refine: body written by the refinement of #36. next: waiting (depends on #362 merged and a published seed containing it)
TlsStream#116