Fixed a bug in the alphanumeric mode encoder function.

pull/134/head
Project Nayuki 7 years ago
parent 2fc396a607
commit 68fdc6024e

@ -75,7 +75,7 @@ public final class QrSegment {
char c = text.charAt(i); char c = text.charAt(i);
if (c >= ALPHANUMERIC_MAP.length || ALPHANUMERIC_MAP[c] == -1) if (c >= ALPHANUMERIC_MAP.length || ALPHANUMERIC_MAP[c] == -1)
throw new IllegalArgumentException("String contains unencodable characters in alphanumeric mode"); throw new IllegalArgumentException("String contains unencodable characters in alphanumeric mode");
accumData = accumData * 10 + ALPHANUMERIC_MAP[c]; accumData = accumData * 45 + ALPHANUMERIC_MAP[c];
accumCount++; accumCount++;
if (accumCount == 2) { if (accumCount == 2) {
bb.appendBits(accumData, 11); bb.appendBits(accumData, 11);

Loading…
Cancel
Save