1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-20 03:17:12 +00:00

RAW_TEXT: change source to be unconverted, i.e. UTF-8 (unless

`DATA_MODE`); allows ZXing-C++ to be built in writer-only mode
  without needing "libzueci"
library: in GS1 mode check that ECI if any is ASCII compatible
general: some code fiddling, `mode` -> `modes`
This commit is contained in:
gitlost
2025-09-05 17:23:18 +01:00
parent 44e2099a65
commit 9b4d097516
39 changed files with 798 additions and 630 deletions

View File

@@ -518,6 +518,7 @@ INTERNAL int zint_mailmark_2d(struct zint_symbol *symbol, unsigned char source[]
char postcode[10];
int i;
struct zint_seg segs[1];
const int raw_text = symbol->output_options & BARCODE_RAW_TEXT;
if (length > 90) {
return z_errtxtf(ZINT_ERROR_TOO_LONG, symbol, 589, "Input length %d too long (maximum 90)", length);
@@ -660,6 +661,16 @@ INTERNAL int zint_mailmark_2d(struct zint_symbol *symbol, unsigned char source[]
segs[0].source = local_source;
segs[0].length = length;
if (raw_text) {
if ((symbol->input_mode & 0x07) == DATA_MODE) {
if (z_rt_cpy(symbol, local_source, length)) {
return ZINT_ERROR_MEMORY; /* `z_rt_cpy()` only fails with OOM */
}
} else if (z_rt_cpy_iso8859_1(symbol, local_source, length)) {
return ZINT_ERROR_MEMORY; /* `z_rt_cpy_iso8859_1()` only fails with OOM */
}
}
return zint_datamatrix(symbol, segs, 1);
}