Skip to content

Commit 662ddf4

Browse files
macchiatipedberg-icu
authored andcommitted
CLDR-17570 Fix a warning on rationals
1 parent 4e9941a commit 662ddf4

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

bin/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/fixedcandidates/
2+
/org/

common/main/root.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3950,7 +3950,7 @@ Warnings: All cp values have U+FE0F characters removed. See /annotationsDerived/
39503950
<rationalFormats numberSystem="latn">
39513951
<rationalPattern>{0}⁄{1}</rationalPattern>
39523952
<integerAndRationalPattern>{0}&#x202F;{1}</integerAndRationalPattern>
3953-
<integerAndRationalPattern alt="superSub">{0}&#x200b;{1}</integerAndRationalPattern>
3953+
<integerAndRationalPattern alt="superSub">{0}&#x2060;{1}</integerAndRationalPattern>
39543954
<rationalUsage>sometimes</rationalUsage>
39553955
</rationalFormats>
39563956
<rationalFormats numberSystem="adlm">

tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckForExemplars.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@
5151
import org.unicode.cldr.util.XPathParts;
5252

5353
public class CheckForExemplars extends FactoryCheckCLDR {
54-
private static final UnicodeSet RTL_CONTROLS = new UnicodeSet("[\\u061C\\u200E\\u200F]");
54+
public static final UnicodeSet RTL_CONTROLS =
55+
new UnicodeSet("[\\u061C\\u200E\\u200F]").freeze();
5556

56-
private static final UnicodeSet ILLEGAL_RTL_CONTROLS =
57+
public static final UnicodeSet ILLEGAL_RTL_CONTROLS =
5758
new UnicodeSet("[\\u202A-\\u202E\\u2066-\\u2069]");
5859

59-
private static final UnicodeSet RTL = new UnicodeSet("[[:bc=AL:][:bc=R:]]");
60+
public static final UnicodeSet LB_JOIN_CONTROLS = new UnicodeSet("[\\u200B\\u2060]").freeze();
61+
62+
public static final UnicodeSet RTL = new UnicodeSet("[[:bc=AL:][:bc=R:]]").freeze();
6063

6164
private static final String STAND_IN = "#";
6265

@@ -264,7 +267,7 @@ public CheckCLDR handleSetCldrFileToCheck(
264267
exemplars.add(STAND_IN);
265268
}
266269

267-
exemplars.addAll(CheckExemplars.AlwaysOK).freeze();
270+
exemplars.addAll(CheckExemplars.AlwaysOK).addAll(LB_JOIN_CONTROLS).freeze();
268271
exemplarsPlusAscii = new UnicodeSet(exemplars).addAll(ASCII).freeze();
269272

270273
skip = false;

tools/cldr-code/src/main/java/org/unicode/cldr/util/CodePointEscaper.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,19 @@ public enum CodePointEscaper {
2020
TAB(9, "tab"),
2121
LF(0xA, "line feed"),
2222
CR(0xD, "carriage return"),
23+
24+
// Spaces
2325
SP(0x20, "space", "ASCII space"),
2426
TSP(0x2009, "thin space", "Aka ‘narrow space’"),
25-
NBSP(0xA0, "no-break space", "Same as space, but doesn’t line wrap."),
2627

28+
// No-break versions
29+
NBSP(0xA0, "no-break space", "Same as space, but doesn’t line wrap."),
2730
NBTSP(
2831
0x202F,
2932
"no-break thin space",
3033
"Same as thin space, but doesn’t line wrap. Aka 'narrow no-break space'"),
3134

35+
// Line Break control
3236
WNJ(
3337
0x200B,
3438
"allow line wrap after, aka ZWSP",
@@ -73,6 +77,13 @@ public enum CodePointEscaper {
7377
ESCS('❰', "escape start", "heavy open angle bracket"),
7478
ESCE('❱', "escape end", "heavy close angle bracket");
7579

80+
// Alternates: Thin vs Narrow, order of NB vs those
81+
public static final CodePointEscaper NSP = TSP;
82+
public static final CodePointEscaper NBNSP = NBTSP;
83+
public static final CodePointEscaper NNBSP = NBTSP;
84+
public static final CodePointEscaper TNBSP = NBTSP;
85+
public static final CodePointEscaper ZWSP = WNJ;
86+
7687
public static final char RANGE_SYNTAX = (char) RANGE.getCodePoint();
7788
public static final char ESCAPE_START = (char) ESCS.getCodePoint();
7889
public static final char ESCAPE_END = (char) ESCE.getCodePoint();
@@ -100,7 +111,7 @@ public enum CodePointEscaper {
100111
new UnicodeSet("[\\uFE0F\\U000E0020-\\U000E007F]").freeze();
101112

102113
public static final UnicodeSet FORCE_ESCAPE =
103-
new UnicodeSet("[[:DI:][:Pat_WS:][:WSpace:][:C:][:Z:]\u200B]")
114+
new UnicodeSet("[[:DI:][:Pat_WS:][:WSpace:][:C:][:Z:]\u200B\u2060]")
104115
.addAll(getNamedEscapes())
105116
.removeAll(EMOJI_INVISIBLES)
106117
.freeze();

tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestExampleGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,7 @@ public void testRationals() {
23092309
{
23102310
"en",
23112311
"//ldml/numbers/rationalFormats[@numberSystem=\"latn\"]/integerAndRationalPattern[@alt=\"superSub\"]",
2312-
"〖❬3❭❰WNJ❱❬½❭〗〖❬3❭❰WNJ❱❬<sup>1</sup>⁄<sub>2</sub>❭〗"
2312+
"〖❬3❭❰WJ❱❬½❭〗〖❬3❭❰WJ❱❬<sup>1</sup>⁄<sub>2</sub>❭〗"
23132313
},
23142314
{"en", "//ldml/numbers/rationalFormats[@numberSystem=\"latn\"]/rationalUsage", null},
23152315
{
@@ -2325,7 +2325,7 @@ public void testRationals() {
23252325
{
23262326
"hi",
23272327
"//ldml/numbers/rationalFormats[@numberSystem=\"deva\"]/integerAndRationalPattern[@alt=\"superSub\"]",
2328-
"〖❬३❭❰WNJ❱❬<sup>१</sup>⁄<sub>२</sub>❭〗"
2328+
"〖❬३❭❰WJ❱❬<sup>१</sup>⁄<sub>२</sub>❭〗"
23292329
},
23302330
{"hi", "//ldml/numbers/rationalFormats[@numberSystem=\"deva\"]/rationalUsage", null},
23312331
};

0 commit comments

Comments
 (0)