Upgraded some of Java QrSegmentAdvanced's private methods to handle full Unicode code points instead of UTF-16 code units.

pull/39/merge
Project Nayuki 6 years ago
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;
}
private static boolean isNumeric(char c) {
private static boolean isNumeric(int c) {
return '0' <= c && c <= '9';
}
@ -265,8 +265,8 @@ public final class QrSegmentAdvanced {
}
private static boolean isKanji(char c) {
return UNICODE_TO_QR_KANJI[c] != -1;
private static boolean isKanji(int c) {
return c < UNICODE_TO_QR_KANJI.length && UNICODE_TO_QR_KANJI[c] != -1;
}

Loading…
Cancel
Save