Skip to content

Commit

Permalink
Fixing checksum error in UPC-E barcodes (#1130)
Browse files Browse the repository at this point in the history
* Converting to UPC-A before checking for matching check digits
  • Loading branch information
fitchfuloffun authored and srowen committed Feb 4, 2019
1 parent 5e8c3d4 commit eb6bea6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/com/google/zxing/oned/UPCEWriter.java
Expand Up @@ -64,7 +64,7 @@ public boolean[] encode(String contents) {
break;
case 8:
try {
if (!UPCEANReader.checkStandardUPCEANChecksum(contents)) {
if (!UPCEANReader.checkStandardUPCEANChecksum(UPCEReader.convertUPCEtoUPCA(contents))) {
throw new IllegalArgumentException("Contents do not pass checksum");
}
} catch (FormatException ignored) {
Expand Down

0 comments on commit eb6bea6

Please sign in to comment.