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:
Project Nayuki 2018-08-28 16:54:58 +00:00
parent a2fe36e1c0
commit b3a34bdd3d
1 changed files with 4 additions and 4 deletions

View File

@ -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;
}