@@ -42,6 +42,9 @@ public abstract class UnicodeEncoding extends MultiByteEncoding {
42
42
43
43
private static final int MAX_WORD_LENGTH = Config .USE_UNICODE_PROPERTIES ? 44 : 6 ;
44
44
private static final int PROPERTY_NAME_MAX_SIZE = MAX_WORD_LENGTH + 1 ;
45
+ static final int I_WITH_DOT_ABOVE = 0x0130 ;
46
+ static final int DOTLESS_i = 0x0131 ;
47
+ static final int DOT_ABOVE = 0x0307 ;
45
48
46
49
protected UnicodeEncoding (String name , int minLength , int maxLength , int []EncLen , int [][]Trans ) {
47
50
// ASCII type tables for all Unicode encodings
@@ -112,10 +115,10 @@ public int mbcCaseFold(int flag, byte[]bytes, IntHolder pp, int end, byte[]fold)
112
115
113
116
if (Config .USE_UNICODE_CASE_FOLD_TURKISH_AZERI ) {
114
117
if ((flag & Config .CASE_FOLD_TURKISH_AZERI ) != 0 ) {
115
- if (code == 0x0049 ) {
116
- return codeToMbc (0x0131 , fold , foldP );
117
- } else if (code == 0x0130 ) {
118
- return codeToMbc (0x0069 , fold , foldP );
118
+ if (code == 'I' ) {
119
+ return codeToMbc (DOTLESS_i , fold , foldP );
120
+ } else if (code == I_WITH_DOT_ABOVE ) {
121
+ return codeToMbc ('i' , fold , foldP );
119
122
}
120
123
}
121
124
}
@@ -170,14 +173,14 @@ public void applyAllCaseFold(int flag, ApplyAllCaseFoldFunction fun, Object arg)
170
173
}
171
174
172
175
if (Config .USE_UNICODE_CASE_FOLD_TURKISH_AZERI && (flag & Config .CASE_FOLD_TURKISH_AZERI ) != 0 ) {
173
- code [0 ] = 0x0131 ;
174
- fun .apply (0x0049 , code , 1 , arg );
175
- code [0 ] = 0x0049 ;
176
- fun .apply (0x0131 , code , 1 , arg );
177
- code [0 ] = 0x0130 ;
178
- fun .apply (0x0069 , code , 1 , arg );
179
- code [0 ] = 0x0069 ;
180
- fun .apply (0x0130 , code , 1 , arg );
176
+ code [0 ] = DOTLESS_i ;
177
+ fun .apply ('I' , code , 1 , arg );
178
+ code [0 ] = 'I' ;
179
+ fun .apply (DOTLESS_i , code , 1 , arg );
180
+ code [0 ] = I_WITH_DOT_ABOVE ;
181
+ fun .apply ('i' , code , 1 , arg );
182
+ code [0 ] = 'i' ;
183
+ fun .apply (I_WITH_DOT_ABOVE , code , 1 , arg );
181
184
} else {
182
185
for (int i =0 ; i <CaseUnfold11 .Locale_From .length ; i ++) {
183
186
int from = CaseUnfold11 .Locale_From [i ];
@@ -258,14 +261,14 @@ public void applyAllCaseFold(int flag, ApplyAllCaseFoldFunction fun, Object arg)
258
261
259
262
if (Config .USE_UNICODE_CASE_FOLD_TURKISH_AZERI ) {
260
263
if ((flag & Config .CASE_FOLD_TURKISH_AZERI ) != 0 ) {
261
- if (code == 0x0049 ) {
262
- return new CaseFoldCodeItem []{new CaseFoldCodeItem (len , 1 , new int []{0x0131 })};
263
- } else if (code == 0x0130 ) {
264
- return new CaseFoldCodeItem []{new CaseFoldCodeItem (len , 1 , new int []{0x0069 })};
265
- } else if (code == 0x0131 ) {
266
- return new CaseFoldCodeItem []{new CaseFoldCodeItem (len , 1 , new int []{0x0049 })};
267
- } else if (code == 0x0069 ) {
268
- return new CaseFoldCodeItem []{new CaseFoldCodeItem (len , 1 , new int []{0x0130 })};
264
+ if (code == 'I' ) {
265
+ return new CaseFoldCodeItem []{new CaseFoldCodeItem (len , 1 , new int []{DOTLESS_i })};
266
+ } else if (code == I_WITH_DOT_ABOVE ) {
267
+ return new CaseFoldCodeItem []{new CaseFoldCodeItem (len , 1 , new int []{'i' })};
268
+ } else if (code == DOTLESS_i ) {
269
+ return new CaseFoldCodeItem []{new CaseFoldCodeItem (len , 1 , new int []{'I' })};
270
+ } else if (code == 'i' ) {
271
+ return new CaseFoldCodeItem []{new CaseFoldCodeItem (len , 1 , new int []{I_WITH_DOT_ABOVE })};
269
272
}
270
273
}
271
274
} // USE_UNICODE_CASE_FOLD_TURKISH_AZERI
@@ -418,9 +421,6 @@ public void applyAllCaseFold(int flag, ApplyAllCaseFoldFunction fun, Object arg)
418
421
}
419
422
420
423
static final int CASE_MAPPING_SLACK = 12 ;
421
- static final int I_WITH_DOT_ABOVE = 0x0130 ;
422
- static final int DOTLESS_i = 0x0131 ;
423
- static final int DOT_ABOVE = 0x0307 ;
424
424
425
425
@ Override
426
426
public final int caseMap (IntHolder flagP , byte [] bytes , IntHolder pp , int end , byte [] to , int toP , int toEnd ) {
0 commit comments