mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Additional fix for issue #300 (HT micjahn)
This commit is contained in:
parent
4b02337709
commit
625d9b77d7
|
@ -73,10 +73,11 @@ final class X12Encoder extends C40Encoder {
|
|||
int available = context.getSymbolInfo().getDataCapacity() - context.getCodewordCount();
|
||||
int count = buffer.length();
|
||||
context.pos -= count;
|
||||
if (context.getRemainingCharacters() != 1 || available != 1) {
|
||||
if (context.getRemainingCharacters() > 1 || available > 1 ||
|
||||
context.getRemainingCharacters() != available) {
|
||||
context.writeCodeword(HighLevelEncoder.X12_UNLATCH);
|
||||
}
|
||||
if (count > 0) {
|
||||
if (context.getNewEncoding() < 0) {
|
||||
context.signalEncoderChange(HighLevelEncoder.ASCII_ENCODATION);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -325,6 +325,12 @@ public final class HighLevelEncodeTestCase extends Assert {
|
|||
assertEquals("238 9 10 104 141 254 50 129", visualized);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testX12Unlatch2() {
|
||||
String visualized = encodeHighLevel("*DTCP0");
|
||||
assertEquals("238 9 10 104 141", visualized);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBug3048549() {
|
||||
//There was an IllegalArgumentException for an illegal character here because
|
||||
|
|
Loading…
Reference in a new issue