Used-supplied workaround for encoders which append spurious latch to ASCII at end of bit stream

git-svn-id: https://zxing.googlecode.com/svn/trunk@1759 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-05-07 13:43:23 +00:00
parent a48dbeab11
commit 379ee79702

View file

@ -168,8 +168,13 @@ final class DecodedBitStreamParser {
//throw ReaderException.getInstance();
// Ignore this symbol for now
} else if (oneByte >= 242) { // Not to be used in ASCII encodation
// ... but work around encoders that end with 254, latch back to ASCII
if (oneByte == 254 && bits.available() == 0) {
// Ignore
} else {
throw FormatException.getFormatInstance();
}
}
} while (bits.available() > 0);
return ASCII_ENCODE;
}