Skip to content

Commit c942b20

Browse files
committed
cases: fix case mappings to allow for Gregorian uppercase
Prepare for Unicode 11, where in some cases an undefined title case is lower case, instead of upper case. Updates golang/go#27945 Change-Id: I96d6921434e344271c80dbc4033b5952b8284178 Reviewed-on: https://go-review.googlesource.com/c/text/+/169640 Run-TryBot: Marcel van Lohuizen <[email protected]> Reviewed-by: Russ Cox <[email protected]>
1 parent 009a891 commit c942b20

File tree

3 files changed

+220
-222
lines changed

3 files changed

+220
-222
lines changed

cases/gen.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func makeException(ri *runeInfo) {
355355
log.Fatalf("%U: has zero-length mapping.", ri.Rune)
356356
}
357357
*b <<= 3
358-
if s != orig {
358+
if s != orig || ri.CaseMode == cLower {
359359
n := len(s)
360360
if n > 7 {
361361
log.Fatalf("%U: mapping larger than 7 (%d)", ri.Rune, n)
@@ -384,12 +384,6 @@ func makeException(ri *runeInfo) {
384384
addString(uc, &exceptionData[p])
385385
}
386386
if ct != cTitle {
387-
// If title is the same as upper, we set it to the original string so
388-
// that it will be marked as not present. This implies title case is
389-
// the same as upper case.
390-
if tc == uc {
391-
tc = orig
392-
}
393387
addString(tc, &exceptionData[p])
394388
}
395389
}

0 commit comments

Comments
 (0)