ZXing 3.3.2 snapshot still creates wrong barcode for text with leadin… (#967)

* ZXing 3.3.2 snapshot still creates wrong barcode for text with leading asterisk #960

* missing spaces
This commit is contained in:
Michael Jahn 2018-03-04 22:17:40 +01:00 committed by Sean Owen
parent c3d649f6ab
commit a3bbebccba

View file

@ -66,6 +66,11 @@ final class EdifactEncoder implements Encoder {
context.updateSymbolInfo();
int available = context.getSymbolInfo().getDataCapacity() - context.getCodewordCount();
int remaining = context.getRemainingCharacters();
// The following two lines are a hack inspired by the 'fix' from https://sourceforge.net/p/barcode4j/svn/221/
if (remaining > available) {
context.updateSymbolInfo(context.getCodewordCount() + 1);
available = context.getSymbolInfo().getDataCapacity() - context.getCodewordCount();
}
if (remaining <= available && available <= 2) {
return; //No unlatch
}