Repository navigation
Update unicode - #3
Merged
Merged
Conversation
toots
marked this pull request as ready for review
August 2, 2026 17:58
Member
Author
|
This is a relatively straight forward lift of the existing mechanisms already in place and in need of TLC for a while. Will merge soon and prepare a release unless there is an objection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update Unicode data to 17.0.0
Camomile's Unicode Character Database was still at 3.2, dated 2002, so everything added to Unicode since then was missing: scripts, code points, case mappings, collation weights.
Beyond the data refresh, the parts of the library that had the Unicode data baked into their source are now generated from the data itself, so future updates are a data change and nothing else.
UCharInfo.script_typeandUCharInfo.version_typeare produced by a newsrc/tools/gen_unidata.mlfromScripts.txtandDerivedAge.txt. The old hand-writtenversion_typealso encoded versions asChar.chr (major * 16 + minor), which overflows at Unicode 16; versions are now a sequential byte, still ordered so thatUCharInfo.olderstays a plain comparison. Note that`v1_0is gone, since the UCD only tracks ages from 1.1 onwards.Refreshing the data is a dune alias:
It downloads the latest published release and rewrites the vendored files in place; without
--auto-promoteit only reports what is out of date. The variable is what gates the download. It is needed becausedune buildbuilds every declared target in the tree, and the vendored data must stay buildable offline — with the variable unset the alias does nothing and says so rather than passing silently.Two parser fixes were required for the modern formats:
parse_allkeysfor the three-weight collation element syntax and the@implicitweightsdirectives, andparse_scriptsfor regexps that were matching a literal backslash instead of a tab.One library bug surfaced: canonical composition ignored the blocking rule of UAX #15 D115 and composed across an intervening character of higher combining class, so
NFC("େ̴ା")wrongly yieldedୋ̴. Fixed inuNF.ml.Tests
The conformance data moves to upstream's
_SHORTvariants, which carry the same 208k and 230k test lines without the comment column, cuttingtest/unidatafrom 41M to 5M.NormalizationTest.txtnow passes in full, 506,668 cases, which it did not before the composition fix.The UCA collation conformance suites and the Thai word list are excluded from
dune runtestand run underdune build @uca-conformance, where 702 of ~456k assertions fail. Both causes are pre-existing and only became visible because the modern test file is 25 times larger.uCol.mlstrips completely ignorable characters before matching contractions, which defeats the blocking rule of UAX #10 S2.1.1-S2.1.3 —0B47 1D165 0B3Econtracts to 0B4B when it should not. Keeping those characters costs about as many failures elsewhere, so the fix is a rework ofuColrather than a patch, and is left for separate work. Separately, the Thai tailoring insrc/locales/th.txtdates from 2001 and conflicts with the prevowel handling DUCET now does natively. This is documented intest/tester/test_uCol.ml.Everything else is green.