mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
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:
parent
c3d649f6ab
commit
a3bbebccba
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue