grapheme.test failures with Unicode 18
This ticket is just meant to track the issue.
The failures are:
grapheme.test
==== grapheme-prev-ucd-659.0 ÷ [1.0] VEDIC SIGN JIHVAMULIYA (ConjunctLinkermExtend) × [9.3] DEVANAGARI LETTER KA (LinkingConsonant) ÷ [2.0] FAILED
==== Contents of test case:
set text [join $graphemes ""]
set l {}
set i end
while {[set grapheme [grapheme prev $text i]] ne ""} {
lappend l $grapheme
}
lreverse $l
---- Result was:
\u1CF5 \u0915
---- Result should have been (exact matching):
\u1CF5\u0915
==== grapheme-prev-ucd-659.0 FAILED
==== grapheme-prev-ucd-875.0 ÷ [1.0] VEDIC SIGN JIHVAMULIYA (ConjunctLinkermExtend) × [9.3] BENGALI LETTER KA (LinkingConsonant) ÷ [2.0] FAILED
==== Contents of test case:
set text [join $graphemes ""]
set l {}
set i end
while {[set grapheme [grapheme prev $text i]] ne ""} {
lappend l $grapheme
}
lreverse $l
---- Result was:
\u1CF5 \u0995
---- Result should have been (exact matching):
\u1CF5\u0995
==== grapheme-prev-ucd-875.0 FAILED
==== grapheme-prev-ucd-876.0 ÷ [1.0] VEDIC SIGN UPADHMANIYA (ConjunctLinkermExtend) × [9.3] BENGALI LETTER PA (LinkingConsonant) ÷ [2.0] FAILED
==== Contents of test case:
set text [join $graphemes ""]
set l {}
set i end
while {[set grapheme [grapheme prev $text i]] ne ""} {
lappend l $grapheme
}
lreverse $l
---- Result was:
\u1CF6 \u09AA
---- Result should have been (exact matching):
\u1CF6\u09AA
==== grapheme-prev-ucd-876.0 FAILED
==== grapheme-prev-ucd-879.0 ÷ [1.0] ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA (ConjunctLinkermExtend) × [9.3] ZANABAZAR SQUARE LETTER KA (LinkingConsonant) ÷ [2.0] FAILED
==== Contents of test case:
set text [join $graphemes ""]
set l {}
set i end
while {[set grapheme [grapheme prev $text i]] ne ""} {
lappend l $grapheme
}
lreverse $l
---- Result was:
\U00011A3A \U00011A0B
---- Result should have been (exact matching):
\U00011A3A\U00011A0B
==== grapheme-prev-ucd-879.0 FAILED
Tests ended at 2026-08-26 14:39:34 CEST
all.tcl: Total 41618 Passed 41614 Skipped 0 Failed 4
Sourced 1 Test Files.
Files with failing tests: grapheme.test
fb18e9d7a0Fix for [3b2a527ed3] - grapheme prev failures check-in2026-10-04 17:50:2328dad48b93Testcases for [3b2a527ed3]: grapheme.test failures with Unicode 18 check-in2026-08-26 12:48:56
I believe this is same as what was ticketed earlier and being tracked upstream. Already fixed but awaiting Unicode 18.0 release before merge into utf8proc main.
> Already fixed but awaiting Unicode 18.0 release
The PR which should fix this is already in Tk trunk. It helps a lot, the number of failing tests goes down from 16 to only 4. So, upstream it's not fixed 100% yet.
Utf8proc 2.12.0 is released now. Still, those 4 testcases fail.
I should be able to look at this in a week or so. No urgency for 9.1 since it is unsupported in any case and the failures are corner cases that have changed in Unicode 18 vs 17.
I just noticed that all four failures are with moving backward through the string. utf8proc itself does not provide a function to do that and the standard only prescribes the algorithm for moving forward. So the bug is likely in my implementation of the GraphemePrev function. I'll revisit later.
Confirming that the testcases now pass in the "bug-3b2a52-apn" branch.
Thanks!