Upgraded some of Java QrSegmentAdvanced's private methods to handle full Unicode code points instead of UTF-16 code units.
This commit is contained in:
parent
a2fe36e1c0
commit
b3a34bdd3d
|
@ -204,11 +204,11 @@ public final class QrSegmentAdvanced {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean isAlphanumeric(char c) {
|
private static boolean isAlphanumeric(int c) {
|
||||||
return isNumeric(c) || 'A' <= c && c <= 'Z' || " $%*+./:-".indexOf(c) != -1;
|
return isNumeric(c) || 'A' <= c && c <= 'Z' || " $%*+./:-".indexOf(c) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isNumeric(char c) {
|
private static boolean isNumeric(int c) {
|
||||||
return '0' <= c && c <= '9';
|
return '0' <= c && c <= '9';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,8 +265,8 @@ public final class QrSegmentAdvanced {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean isKanji(char c) {
|
private static boolean isKanji(int c) {
|
||||||
return UNICODE_TO_QR_KANJI[c] != -1;
|
return c < UNICODE_TO_QR_KANJI.length && UNICODE_TO_QR_KANJI[c] != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue