mirror of
https://git.code.sf.net/p/zint/code
synced 2026-05-11 08:33:48 +00:00
AZTEC: add manual FNC1 support:
improve P/S vs P/L choice when have ECI; add ZINT_DEBUG_TEST dump AUSPOST: allow variable length data input DATAMATRIX: do `EXTRA_ESCAPE_MODE` processing up front & check have non-zero length afterwards; disallow `READER_INIT` and `EXTRA_ESCAPE_MODE`; general: add new `z_zero_fill()` func & use; add new `z_extra_escape_position_fnc1()` helper; in `z_ct_set_seg_extra_escapes_eci` check position FNC1 whether or not have ECI library: escape_char_process: note escaped backslash followed by caret by passes `EXTRA_ESCAPE_MODE` check test suite: BWIPP: update to latest; support AUSPOST variants; process `EXTRA_ESCAPE_MODE` escaping up front
This commit is contained in:
@@ -367,7 +367,8 @@ static int supports_non_iso8859_1(const int symbology) {
|
||||
/* Returns 1 if `symbol` can process EXTRA_ESCAPE_MODE */
|
||||
static int supports_extra_escape_mode(const struct zint_symbol *const symbol) {
|
||||
return symbol->symbology == BARCODE_CODE128
|
||||
|| (symbol->symbology == BARCODE_DATAMATRIX && (symbol->input_mode & 0x07) != GS1_MODE);
|
||||
|| ((symbol->symbology == BARCODE_AZTEC || symbol->symbology == BARCODE_DATAMATRIX)
|
||||
&& (symbol->input_mode & 0x07) != GS1_MODE);
|
||||
}
|
||||
|
||||
/* Returns 1 if symbology supports HRT */
|
||||
@@ -752,12 +753,15 @@ static int escape_char_process(struct zint_symbol *symbol, const unsigned char *
|
||||
case '\\':
|
||||
if (escaped_string) escaped_string[out_posn] = vals[z_posn(escs, ch)];
|
||||
in_posn += 2;
|
||||
/* Note: if given double backslash following by caret "\\^" then will be passed through as "\^",
|
||||
i.e. the start of an extra escape sequence, avoiding the check below, so each symbology needs
|
||||
to also check themselves */
|
||||
break;
|
||||
case '^': /* Symbology specific */
|
||||
if (!extra_escape_mode || !can_extra_escape) {
|
||||
if (!extra_escape_mode) {
|
||||
return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 798,
|
||||
"Escape '\\^' only valid in extra escape mode");
|
||||
"Escape '\\^' only valid in Extra Escape mode");
|
||||
}
|
||||
return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 213,
|
||||
"Extra escape '\\^' not valid for this symbology and/or input mode");
|
||||
|
||||
Reference in New Issue
Block a user