Skip to content

Commit a78905c

Browse files
committedDec 23, 2017
sync constants for turkish-azeri
1 parent 2b10c9b commit a78905c

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed
 

‎src/org/jcodings/unicode/UnicodeEncoding.java

+23-23
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public abstract class UnicodeEncoding extends MultiByteEncoding {
4242

4343
private static final int MAX_WORD_LENGTH = Config.USE_UNICODE_PROPERTIES ? 44 : 6;
4444
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;
4548

4649
protected UnicodeEncoding(String name, int minLength, int maxLength, int[]EncLen, int[][]Trans) {
4750
// ASCII type tables for all Unicode encodings
@@ -112,10 +115,10 @@ public int mbcCaseFold(int flag, byte[]bytes, IntHolder pp, int end, byte[]fold)
112115

113116
if (Config.USE_UNICODE_CASE_FOLD_TURKISH_AZERI) {
114117
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);
119122
}
120123
}
121124
}
@@ -170,14 +173,14 @@ public void applyAllCaseFold(int flag, ApplyAllCaseFoldFunction fun, Object arg)
170173
}
171174

172175
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);
181184
} else {
182185
for (int i=0; i<CaseUnfold11.Locale_From.length; i++) {
183186
int from = CaseUnfold11.Locale_From[i];
@@ -258,14 +261,14 @@ public void applyAllCaseFold(int flag, ApplyAllCaseFoldFunction fun, Object arg)
258261

259262
if (Config.USE_UNICODE_CASE_FOLD_TURKISH_AZERI) {
260263
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})};
269272
}
270273
}
271274
} // USE_UNICODE_CASE_FOLD_TURKISH_AZERI
@@ -418,9 +421,6 @@ public void applyAllCaseFold(int flag, ApplyAllCaseFoldFunction fun, Object arg)
418421
}
419422

420423
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;
424424

425425
@Override
426426
public final int caseMap(IntHolder flagP, byte[] bytes, IntHolder pp, int end, byte[] to, int toP, int toEnd) {

0 commit comments

Comments
 (0)
Please sign in to comment.