diff --git a/ChangeLog b/ChangeLog index 8e527230..94f1d9c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,16 +1,18 @@ -Version 2.16.0.9 (dev) not released yet (2026-03-30) +Version 2.16.0.9 (dev) not released yet (2026-04-18) ==================================================== **Incompatible changes** ------------------------ +- Code 128 now errors on unrecognized extra escape sequences + (previously just passed them through) - Aztec error codeword percentages adjusted to be at least advertised values (may cause symbol size change, and generation failure if specified) - Improved Aztec encodation algorithm (may cause symbol size change) - New Qt Backend method `save_as_memfile()` to save file to memory - New Qt Backend methods `gs1Raw()` and `setGS1Raw()` for new `GS1RAW_MODE` option for processing GS1 input -- CLI now warns if both "--dmre" and "--square" are given (previously silently - ignored "--dmre") +- CLI now warns if both "--dmre" and "--square" are given + (previously silently ignored "--dmre") Changes ------- @@ -32,11 +34,14 @@ Changes - DATAMATRIX: new options "--dmb256=" (`option_3 = DM_B256_START`) & "--dmc40=" (`option_3 = DM_C40_START`) to allow forcing of initial encodation for given no. (`option_1`) of initial characters, with 0 meaning all +- DATAMATRIX: add manual FNC1 support Bugs ---- - CODE128: fix not handling FNC1 at end of data when in manual switching mode - or any FNC1 after manual C mode selected and no other non-C data + or any FNC1 after manual C mode selected and no other non-C data; + fix possible shifting before manual FNC1 in 2nd position after single alpha; + fix not removing manual FNC1 in 1st/2nd position from content segs - CLI: fix "--scalexdimdp" X-dim inch units being divided instead of multiplied on conversion to mm - DOTCODE: fix not emitting FNC1 (signalling not GS1) if input is just 2 digits diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index 802656fe..c0adcddd 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (C) 2008 by BogDan Vatra < bogdan@licentia.eu > -# Copyright (C) 2009-2025 Robin Stuart +# Copyright (C) 2009-2026 Robin Stuart # vim: set ts=4 sw=4 et : cmake_minimum_required(VERSION 3.10) diff --git a/backend/code128.c b/backend/code128.c index ef8343f0..18df937c 100644 --- a/backend/code128.c +++ b/backend/code128.c @@ -226,7 +226,7 @@ static int c128_cost(const unsigned char source[], const int length, const int i https://github.com/bwipp/postscriptbarcode/pull/278 */ static int c128_set_values(const unsigned char source[], const int length, const int start_idx, const char priority[C128_STATES], const char fncs[C128_MAX], const char manuals[C128_MAX], - int values[C128_VALUES_MAX], int *p_final_cset) { + int values[C128_VALUES_MAX], int *p_first_cset, int *p_final_cset) { short (*costs)[C128_STATES] = (short (*)[C128_STATES]) z_alloca(sizeof(*costs) * length); char (*modes)[C128_STATES] = (char (*)[C128_STATES]) z_alloca(sizeof(*modes) * length); @@ -243,6 +243,18 @@ static int c128_set_values(const unsigned char source[], const int length, const return costs[0][0]; } + if (p_first_cset) { + *p_first_cset = modes[0][0]; + } + + /* Make sure FNC1 in 2nd position after single alpha does not switch modes before FNC1 */ + if (length > 1 && !fncs[0] && fncs[1] && z_isalpha(source[0])) { + const int mode = modes[0][0]; + if (mode == (mode & 0x0F) && mode != modes[1][mode]) { + modes[1][mode] = mode; + } + } + /* Output codewords into `values` */ for (i = 0; i < length; i++) { const unsigned char ch = source[i]; @@ -377,6 +389,7 @@ INTERNAL int zint_code128(struct zint_symbol *symbol, unsigned char source[], in char priority[C128_STATES]; int values[C128_VALUES_MAX] = {0}; int glyph_count; + int first_cset; unsigned char src_buf[C128_MAX + 1]; unsigned char *src = source; const int ab_only = symbol->symbology == BARCODE_CODE128AB; @@ -397,23 +410,27 @@ INTERNAL int zint_code128(struct zint_symbol *symbol, unsigned char source[], in char manual = 0; int j = 0; for (i = 0; i < length; i++) { - if (source[i] == '\\' && i + 2 < length && source[i + 1] == '^' - && ((source[i + 2] >= '@' && source[i + 2] <= 'C') || source[i + 2] == '1' - || source[i + 2] == '^')) { - if (source[i + 2] == '^') { /* Escape sequence '\^^' */ - manuals[j] = manual; - src_buf[j++] = source[i++]; - manuals[j] = manual; - src_buf[j++] = source[i++]; - /* Drop second '^' */ - } else if (source[i + 2] == '1') { /* FNC1 */ - i += 2; - fncs[j] = have_fnc1 = 1; - manuals[j] = manual; - src_buf[j++] = '\x1D'; /* Manual FNC1 dummy */ - } else { /* Manual mode A/B/C/@ */ - i += 2; - manual = source[i] == 'C' ? C128_C0 : source[i] - '@'; /* Assuming A0 = 1, B0 = 2 */ + if (source[i] == '\\' && i + 2 < length && source[i + 1] == '^') { + const unsigned char ch = source[i + 2]; + if ((ch >= '@' && ch <= 'C') || ch == '1' || ch == '^') { + if (ch == '^') { /* Escape sequence '\^^' */ + manuals[j] = manual; + src_buf[j++] = source[i++]; + manuals[j] = manual; + src_buf[j++] = source[i++]; + /* Drop second '^' */ + } else if (ch == '1') { /* FNC1 */ + i += 2; + fncs[j] = have_fnc1 = 1; + manuals[j] = manual; + src_buf[j++] = '\x1D'; /* Manual FNC1 dummy */ + } else { /* Manual mode A/B/C/@ */ + i += 2; + manual = ch == 'C' ? C128_C0 : ch - '@'; /* Assuming A0 = 1, B0 = 2 */ + } + } else { + return z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 348, "Unrecognized extra escape \"\\^%c\"", + !z_isascii(ch) || z_iscntrl(ch) ? '?' : ch); } } else { manuals[j] = manual; @@ -468,7 +485,8 @@ INTERNAL int zint_code128(struct zint_symbol *symbol, unsigned char source[], in } c128_set_priority(priority, have_a, have_b, have_c, have_extended); - glyph_count = c128_set_values(src, length, start_idx, priority, fncs, manuals, values, NULL /*p_final_cset*/); + glyph_count = c128_set_values(src, length, start_idx, priority, fncs, manuals, values, &first_cset, + NULL /*p_final_cset*/); if (symbol->debug & ZINT_DEBUG_PRINT) { printf("Data (%d): %.*s", length, length >= 100 ? 1 : length >= 10 ? 2 : 3, " "); @@ -487,6 +505,36 @@ INTERNAL int zint_code128(struct zint_symbol *symbol, unsigned char source[], in /* ISO/IEC 15417:2007 leaves dimensions/height as application specification */ + /* Do content segs before HRT to deal with manual FNC1s in 1st position & 2nd position */ + if (content_segs) { + if (have_fnc1) { + int mv_idx = 0; + assert(length > 0); + /* Remove manual FNC1 in 1st position */ + if (fncs[0]) { + mv_idx = 1; + /* Remove manual FNC1 in 2nd position, alphabetic */ + } else if (length > 1 && fncs[1] && z_isalpha(src[0])) { + mv_idx = 2; + /* Remove manual FNC1 in 2nd position, 2 digits */ + } else if (first_cset == C128_C0 && length > 2 && fncs[2] && z_isdigit(src[0]) && z_isdigit(src[1])) { + mv_idx = 3; + } + if (mv_idx) { + memmove(src + (mv_idx - 1), src + mv_idx, length - mv_idx); + memmove(fncs + (mv_idx - 1), fncs + mv_idx, length - mv_idx); + length--; + } + } + if ((symbol->input_mode & 0x07) == DATA_MODE) { + if (z_ct_cpy(symbol, src, length)) { + return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */ + } + } else if (z_ct_cpy_iso8859_1(symbol, src, length)) { + return ZINT_ERROR_MEMORY; /* `z_ct_cpy_iso8859_1()` only fails with OOM */ + } + } + /* HRT */ if (have_fnc1) { /* Remove any manual FNC1 dummies ('\x1D') */ @@ -500,16 +548,6 @@ INTERNAL int zint_code128(struct zint_symbol *symbol, unsigned char source[], in } error_number = z_hrt_cpy_iso8859_1(symbol, src, length); /* Returns warning only */ - if (content_segs) { - if ((symbol->input_mode & 0x07) == DATA_MODE) { - if (z_ct_cpy(symbol, src, length)) { - return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */ - } - } else if (z_ct_cpy_iso8859_1(symbol, src, length)) { - return ZINT_ERROR_MEMORY; /* `z_ct_cpy_iso8859_1()` only fails with OOM */ - } - } - return error_number; } @@ -553,7 +591,7 @@ INTERNAL int zint_gs1_128_cc(struct zint_symbol *symbol, unsigned char source[], c128_set_priority(priority, 0 /*have_a*/, 1 /*have_b*/, 1 /*have_c*/, 0 /*have_extended*/); glyph_count = c128_set_values(reduced, reduced_length, 1 /*start_idx*/, priority, fncs, manuals, values, - &final_cset); + NULL /*p_first_cset*/, &final_cset); if (symbol->debug & ZINT_DEBUG_PRINT) { printf("Data (%d): %.*s", reduced_length, reduced_length >= 100 ? 1 : reduced_length >= 10 ? 2 : 3, " "); diff --git a/backend/common.c b/backend/common.c index 72d90743..8b626baf 100644 --- a/backend/common.c +++ b/backend/common.c @@ -776,6 +776,41 @@ INTERNAL int z_utf8_to_unicode(struct zint_symbol *symbol, const unsigned char s return 0; } +/* Process `source` for manual FNC1 extra escape sequences, placing result in `dest` with result length in `p_len`, + and setting `fncs` with found FNC1s. `dest` & `fncs` must be at least `length` in size. `eci` is checked to be + ASCII-compatible (UTF-8 & single-byte ECIs, excl. Binary 899). On error sets `errtxt` & returns error no. */ +INTERNAL int z_extra_escapes(struct zint_symbol *symbol, const unsigned char source[], const int length, + const int eci, unsigned char dest[], char *fncs, int *p_len) { + int i, j = 0; + if (eci == 20 || eci == 25 || eci >= 28) { + return z_errtxt(ZINT_ERROR_INVALID_OPTION, symbol, 716, "Extra escape mode requires ASCII-compatible ECI"); + } + for (i = 0; i < length; i++) { + if (source[i] == '\\' && i + 2 < length && source[i + 1] == '^') { + const unsigned char ch = source[i + 2]; + if (ch == '1' || ch == '^') { + if (ch == '^') { /* Escape sequence '\^^' */ + dest[j++] = source[i++]; + dest[j++] = source[i++]; + /* Drop second '^' */ + } else { /* ch == '1' FNC1 */ + i += 2; + fncs[j] = 1; + dest[j++] = '\x1D'; /* Manual FNC1 dummy */ + } + } else { + return z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 717, "Unrecognized extra escape \"\\^%c\"", + !z_isascii(ch) || z_iscntrl(ch) ? '?' : ch); + } + } else { + dest[j++] = source[i]; + } + } + *p_len = j; + + return 0; +} + /* Treats source as ISO/IEC 8859-1 and copies into `symbol->text`, converting to UTF-8. Control chars (incl. DEL) and non-ISO/IEC 8859-1 (0x80-9F) are replaced with spaces. Returns warning if truncated, else 0 */ INTERNAL int z_hrt_cpy_iso8859_1(struct zint_symbol *symbol, const unsigned char source[], const int length) { @@ -988,10 +1023,52 @@ INTERNAL int z_ct_cpy_segs(struct zint_symbol *symbol, const struct zint_seg seg return 0; } -/* Update the ECI of content seg `seg_idx` to `eci`, to reflect (feedback) the actual ECI used */ -INTERNAL void z_ct_set_seg_eci(struct zint_symbol *symbol, const int seg_idx, const int eci) { +/* Process content seg `seg_idx` buffer for manual FNC1 extra escape sequences (which must exist), + and update its ECI to `eci`, if set, to reflect (feedback) the actual ECI used */ +INTERNAL void z_ct_set_seg_extra_escapes_eci(struct zint_symbol *symbol, const int seg_idx, const int eci) { + int i, j = 0; + unsigned char *source; + int length; + const int no_fnc1_position_check = seg_idx != 0 || eci != 0; + assert(symbol->content_segs); assert(seg_idx >= 0 && seg_idx < symbol->content_seg_count); + assert(symbol->content_segs[seg_idx].source); + + source = symbol->content_segs[seg_idx].source; + length = symbol->content_segs[seg_idx].length; + + for (i = 0; i < length; i++) { + if (source[i] == '\\' && i + 2 < length && source[i + 1] == '^' + && (source[i + 2] == '1' || source[i + 2] == '^')) { + if (source[i + 2] == '^') { /* Escape sequence '\^^' */ + source[j++] = source[i++]; + source[j++] = source[i++]; + /* Drop second '^' */ + } else { /* source[i + 2] == '1' FNC1 */ + /* Do not emit if FNC1 in 1st/2nd position */ + if (no_fnc1_position_check || j > 2 || (j == 1 && !z_isalpha(source[0])) + || (j == 2 && (!z_isdigit(source[0]) || !z_isdigit(source[1]))) ) { + source[j++] = '\x1D'; /* GS */ + } + i += 2; + } + } else { + source[j++] = source[i]; + } + } + assert(j > 0 && j < length); + symbol->content_segs[seg_idx].length = j; + if (eci) { + symbol->content_segs[seg_idx].eci = eci; + } +} + +/* Update the ECI of content seg `seg_idx` to `eci`, to reflect (feedback) the actual ECI used */ +INTERNAL void z_ct_set_seg_eci(struct zint_symbol *symbol, const int seg_idx, const int eci) { + assert(seg_idx >= 0 && seg_idx < symbol->content_seg_count); + assert(eci); + assert(symbol->content_segs); symbol->content_segs[seg_idx].eci = eci; } diff --git a/backend/common.h b/backend/common.h index 481ddc90..91286870 100644 --- a/backend/common.h +++ b/backend/common.h @@ -140,6 +140,7 @@ typedef unsigned __int64 uint64_t; #define z_isdigit(ch) ((ch) <= '9' && (ch) >= '0') #define z_isupper(ch) ((ch) >= 'A' && (ch) <= 'Z') #define z_islower(ch) ((ch) >= 'a' && (ch) <= 'z') +#define z_isalpha(ch) (z_isupper(ch) || z_islower(ch)) #define z_isascii(ch) (!((ch) & ~0x7F)) #define z_iscntrl(ch) (!((ch) & ~0x1F) || (ch) == 127) @@ -307,6 +308,13 @@ INTERNAL int z_utf8_to_unicode(struct zint_symbol *symbol, const unsigned char s int *length, const int disallow_4byte); +/* Process `source` for manual FNC1 extra escape sequences, placing result in `dest` with result length in `p_len`, + and setting `fncs` with found FNC1s. `dest` & `fncs` must be at least `length` in size. `eci` is checked to be + ASCII-compatible (UTF-8 & single-byte ECIs, excl. Binary 899). On error sets `errtxt` & returns error no. */ +INTERNAL int z_extra_escapes(struct zint_symbol *symbol, const unsigned char source[], const int length, + const int eci, unsigned char dest[], char *fncs, int *p_len); + + /* Treats source as ISO/IEC 8859-1 and copies into `symbol->text`, converting to UTF-8. Control chars (incl. DEL) and non-ISO/IEC 8859-1 (0x80-9F) are replaced with spaces. Returns warning if truncated, else 0 */ INTERNAL int z_hrt_cpy_iso8859_1(struct zint_symbol *symbol, const unsigned char source[], const int length); @@ -346,6 +354,10 @@ INTERNAL void z_ct_free_segs(struct zint_symbol *symbol); If seg eci not set, content seg eci set to 3. On error sets `errxtxt`, returning BARCODE_ERROR_MEMORY */ INTERNAL int z_ct_cpy_segs(struct zint_symbol *symbol, const struct zint_seg segs[], const int seg_count); +/* Process content seg `seg_idx` buffer for manual FNC1 extra escape sequences (which must exist), + and update its ECI to `eci`, if set, to reflect (feedback) the actual ECI used */ +INTERNAL void z_ct_set_seg_extra_escapes_eci(struct zint_symbol *symbol, const int seg_idx, const int eci); + /* Update the ECI of content seg `seg_idx` to `eci`, to reflect (feedback) the actual ECI used */ INTERNAL void z_ct_set_seg_eci(struct zint_symbol *symbol, const int seg_idx, const int eci); diff --git a/backend/dmatrix.c b/backend/dmatrix.c index 5c74e893..bc8c81da 100644 --- a/backend/dmatrix.c +++ b/backend/dmatrix.c @@ -282,7 +282,7 @@ static int dm_text_sp_cnt(const unsigned char source[], const int position, cons /* 'look ahead test' from Annex J */ static int dm_look_ahead_test(const unsigned char source[], const int length, const int position, - const int current_mode, const int mode_arg, const int gs1, const int debug_print) { + const int current_mode, const int mode_arg, const char *fncs, const int debug_print) { int ascii_count, c40_count, text_count, x12_count, edf_count, b256_count; int ascii_rnded, c40_rnded, text_rnded, x12_rnded, edf_rnded, b256_rnded; int cnt_1; @@ -316,11 +316,11 @@ static int dm_look_ahead_test(const unsigned char source[], const int length, co } for (sp = position; sp < length; sp++) { - const unsigned char c = source[sp]; - const int is_extended = c & 0x80; + const unsigned char ch = source[sp]; + const int is_extended = ch & 0x80; /* ASCII ... step (l) */ - if (z_isdigit(c)) { + if (z_isdigit(ch)) { ascii_count += DM_MULT_1_DIV_2; /* (l)(1) */ } else { if (is_extended) { @@ -331,7 +331,7 @@ static int dm_look_ahead_test(const unsigned char source[], const int length, co } /* C40 ... step (m) */ - if (dm_isc40(c)) { + if (dm_isc40(ch)) { c40_count += DM_MULT_2_DIV_3; /* (m)(1) */ } else { if (is_extended) { @@ -342,7 +342,7 @@ static int dm_look_ahead_test(const unsigned char source[], const int length, co } /* TEXT ... step (n) */ - if (dm_istext(c)) { + if (dm_istext(ch)) { text_count += DM_MULT_2_DIV_3; /* (n)(1) */ } else { if (is_extended) { @@ -353,7 +353,7 @@ static int dm_look_ahead_test(const unsigned char source[], const int length, co } /* X12 ... step (o) */ - if (dm_isX12(c)) { + if (dm_isX12(ch)) { x12_count += DM_MULT_2_DIV_3; /* (o)(1) */ } else { if (is_extended) { @@ -364,7 +364,7 @@ static int dm_look_ahead_test(const unsigned char source[], const int length, co } /* EDIFACT ... step (p) */ - if (dm_isedifact(c)) { + if (dm_isedifact(ch)) { edf_count += DM_MULT_3_DIV_4; /* (p)(1) */ } else { if (is_extended) { @@ -375,7 +375,7 @@ static int dm_look_ahead_test(const unsigned char source[], const int length, co } /* Base 256 ... step (q) */ - if (gs1 == 1 && c == '\x1D') { + if (fncs[sp] && ch == '\x1D') { /* FNC1 separator */ b256_count += DM_MULT_4; /* (q)(1) */ } else { @@ -615,10 +615,10 @@ static int dm_codewords_remaining(struct zint_symbol *symbol, const int tp, cons } /* Number of C40/TEXT elements needed to encode `input` */ -static int dm_c40text_cnt(const int current_mode, const int gs1, unsigned char input) { +static int dm_c40text_cnt(const int current_mode, const char fnc, unsigned char input) { int cnt; - if (gs1 && input == '\x1D') { + if (fnc && input == '\x1D') { return 2; } cnt = 1; @@ -933,7 +933,7 @@ static void dm_addEdge(struct zint_symbol *symbol, const unsigned char *source, /* Add edges for the various modes at a vertex */ static void dm_addEdges(struct zint_symbol *symbol, const unsigned char source[], const int length, - const int last_seg, struct dm_edge *edges, const int from, struct dm_edge *previous, const int gs1) { + const int last_seg, struct dm_edge *edges, const int from, struct dm_edge *previous, const char *fncs) { int i, pos; assert(from < length); /* Suppress clang-tidy-21 clang-analyzer-security.ArrayBound */ @@ -965,7 +965,7 @@ static void dm_addEdges(struct zint_symbol *symbol, const unsigned char source[] dm_addEdge(symbol, source, length, last_seg, edges, DM_X12, from, 3, previous, 0); } - if (gs1 != 1 || source[from] != '\x1D') { + if (!fncs[from] || source[from] != '\x1D') { dm_addEdge(symbol, source, length, last_seg, edges, DM_BASE256, from, 1, previous, 0); } } @@ -981,7 +981,7 @@ static void dm_addEdges(struct zint_symbol *symbol, const unsigned char source[] /* Calculate optimized encoding modes */ static int dm_define_modes(struct zint_symbol *symbol, char modes[], const unsigned char source[], const int length, - const int last_seg, const int gs1, const int debug_print) { + const int last_seg, const char *fncs, const int debug_print) { int i, j, v_i; int minimalJ, minimalSize; @@ -995,7 +995,7 @@ static int dm_define_modes(struct zint_symbol *symbol, char modes[], const unsig } assert((length + 1) * DM_NUM_MODES < USHRT_MAX); /* Guaranteed by input length limit */ - dm_addEdges(symbol, source, length, last_seg, edges, 0, NULL, gs1); + dm_addEdges(symbol, source, length, last_seg, edges, 0, NULL, fncs); DM_TRACE_Edges("DEBUG Initial situation\n", source, length, edges, 0); @@ -1003,7 +1003,7 @@ static int dm_define_modes(struct zint_symbol *symbol, char modes[], const unsig v_i = i * DM_NUM_MODES; for (j = 0; j < DM_NUM_MODES; j++) { if (edges[v_i + j].mode) { - dm_addEdges(symbol, source, length, last_seg, edges, i, edges + v_i + j, gs1); + dm_addEdges(symbol, source, length, last_seg, edges, i, edges + v_i + j, fncs); } } DM_TRACE_Edges("DEBUG situation after adding edges to vertices at position %d\n", source, length, edges, i); @@ -1060,7 +1060,7 @@ static int dm_define_modes(struct zint_symbol *symbol, char modes[], const unsig /* Do default minimal encodation */ static int dm_minimalenc(struct zint_symbol *symbol, const unsigned char source[], const int length, const int last_seg, int *p_sp, unsigned char target[], int *p_tp, int process_buffer[8], int *p_process_p, - int *p_b256_start, int *p_current_mode, const int gs1, const int debug_print) { + int *p_b256_start, int *p_current_mode, const char *fncs, const int debug_print) { int sp = *p_sp; int tp = *p_tp; int process_p = *p_process_p; @@ -1070,7 +1070,7 @@ static int dm_minimalenc(struct zint_symbol *symbol, const unsigned char source[ assert(length <= 10921); /* Can only handle (10921 + 1) * 6 = 65532 < 65536 (2*16) due to sizeof(previous) */ - if (!dm_define_modes(symbol, modes, source, length, last_seg, gs1, debug_print)) { + if (!dm_define_modes(symbol, modes, source, length, last_seg, fncs, debug_print)) { return z_errtxt(ZINT_ERROR_MEMORY, symbol, 728, "Insufficient memory for mode buffers"); } @@ -1129,14 +1129,9 @@ static int dm_minimalenc(struct zint_symbol *symbol, const unsigned char source[ target[tp++] = (source[sp] - 128) + 1; if (debug_print) printf("FN4 A%02X ", target[tp - 1] - 1); } else { - if (gs1 && source[sp] == '\x1D') { - if (gs1 == 2) { - target[tp++] = 29 + 1; /* GS */ - if (debug_print) fputs("GS ", stdout); - } else { - target[tp++] = 232; /* FNC1 */ - if (debug_print) fputs("FN1 ", stdout); - } + if (fncs[sp] && source[sp] == '\x1D') { + target[tp++] = 232; /* FNC1 */ + if (debug_print) fputs("FN1 ", stdout); } else { target[tp++] = source[sp] + 1; if (debug_print) printf("A%02X ", target[tp - 1] - 1); @@ -1164,14 +1159,9 @@ static int dm_minimalenc(struct zint_symbol *symbol, const unsigned char source[ shift_set = ct_shift[source[sp] - 128]; value = ct_value[source[sp] - 128]; } else { - if (gs1 && source[sp] == '\x1D') { - if (gs1 == 2) { - shift_set = ct_shift[29]; - value = ct_value[29]; /* GS */ - } else { - shift_set = 2; - value = 27; /* FNC1 */ - } + if (fncs[sp] && source[sp] == '\x1D') { + shift_set = 2; + value = 27; /* FNC1 */ } else { shift_set = ct_shift[source[sp]]; value = ct_value[source[sp]]; @@ -1247,7 +1237,7 @@ static int dm_minimalenc(struct zint_symbol *symbol, const unsigned char source[ /* Encode using algorithm based on ISO/IEC 21471:2020 Annex J (was ISO/IEC 21471:2006 Annex P) */ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], const int length, int *p_sp, unsigned char target[], int *p_tp, int process_buffer[8], int *p_process_p, int *p_b256_start, - int *p_current_mode, const int gs1, const int b256_end, const int c40_end, const int debug_print) { + int *p_current_mode, const char *fncs, const int b256_end, const int c40_end, const int debug_print) { int sp = *p_sp; int tp = *p_tp; int process_p = *p_process_p; @@ -1284,7 +1274,7 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c if (debug_print) printf("N%02d ", target[tp - 1] - 130); sp += 2; } else { - next_mode = dm_look_ahead_test(source, length, sp, current_mode, 0, gs1, debug_print); + next_mode = dm_look_ahead_test(source, length, sp, current_mode, 0, fncs, debug_print); if (next_mode != DM_ASCII) { tp = dm_switch_mode(next_mode, target, tp, p_b256_start, debug_print); @@ -1295,14 +1285,9 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c target[tp++] = (source[sp] - 128) + 1; if (debug_print) printf("FN4 A%02X ", target[tp - 1] - 1); } else { - if (gs1 && source[sp] == '\x1D') { - if (gs1 == 2) { - target[tp++] = 29 + 1; /* GS */ - if (debug_print) fputs("GS ", stdout); - } else { - target[tp++] = 232; /* FNC1 */ - if (debug_print) fputs("FN1 ", stdout); - } + if (fncs[sp] && source[sp] == '\x1D') { + target[tp++] = 232; /* FNC1 */ + if (debug_print) fputs("FN1 ", stdout); } else { target[tp++] = source[sp] + 1; if (debug_print) printf("A%02X ", target[tp - 1] - 1); @@ -1317,7 +1302,7 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c next_mode = current_mode; if (process_p == 0 && not_first && (sp >= c40_end)) { /* `c40_end` only set if `current_mode` DM_C40 */ - next_mode = dm_look_ahead_test(source, length, sp, current_mode, process_p, gs1, debug_print); + next_mode = dm_look_ahead_test(source, length, sp, current_mode, process_p, fncs, debug_print); } if (next_mode != current_mode) { @@ -1342,14 +1327,9 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c shift_set = ct_shift[source[sp] - 128]; value = ct_value[source[sp] - 128]; } else { - if (gs1 && source[sp] == '\x1D') { - if (gs1 == 2) { - shift_set = ct_shift[29]; - value = ct_value[29]; /* GS */ - } else { - shift_set = 2; - value = 27; /* FNC1 */ - } + if (fncs[sp] && source[sp] == '\x1D') { + shift_set = 2; + value = 27; /* FNC1 */ } else { shift_set = ct_shift[source[sp]]; value = ct_value[source[sp]]; @@ -1376,7 +1356,7 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c } else { next_mode = DM_X12; if (process_p == 0 && not_first) { - next_mode = dm_look_ahead_test(source, length, sp, current_mode, process_p, gs1, debug_print); + next_mode = dm_look_ahead_test(source, length, sp, current_mode, process_p, fncs, debug_print); } } @@ -1417,7 +1397,7 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c if (process_p == 3) { /* Note different than spec Step (f)(2), which suggests checking when 0, but this seems to work better in many cases as the switch to ASCII is "free" */ - next_mode = dm_look_ahead_test(source, length, sp, current_mode, process_p, gs1, debug_print); + next_mode = dm_look_ahead_test(source, length, sp, current_mode, process_p, fncs, debug_print); } } @@ -1446,12 +1426,12 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c /* step (g) Base 256 encodation */ } else if (current_mode == DM_BASE256) { - if (gs1 == 1 && source[sp] == '\x1D') { + if (fncs[sp] && source[sp] == '\x1D') { next_mode = DM_ASCII; } else { next_mode = DM_BASE256; if (not_first && sp >= b256_end) { - next_mode = dm_look_ahead_test(source, length, sp, current_mode, tp - (*p_b256_start + 1), gs1, + next_mode = dm_look_ahead_test(source, length, sp, current_mode, tp - (*p_b256_start + 1), fncs, debug_print); } } @@ -1490,8 +1470,8 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c /* Encodes data using ASCII, C40, Text, X12, EDIFACT or Base 256 modes as appropriate Supports encoding FNC1 in supporting systems */ -static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], const int length, - const int eci, const int last_seg, const int gs1, const int b256_end, const int c40_end, +static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], int length, + const int eci, const int last_seg, const char *fncs, const int b256_end, const int c40_end, unsigned char target[], int *p_tp) { int sp = 0; int tp = *p_tp; @@ -1520,13 +1500,14 @@ static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], c if (debug_print) printf("ECI %d ", eci + 1); } + /* If FAST_MODE or MAILMARK_2D, do Annex J-based encodation */ if ((symbol->input_mode & FAST_MODE) || b256_end || c40_end) { error_number = dm_isoenc(symbol, source, length, &sp, target, &tp, process_buffer, &process_p, - &b256_start, ¤t_mode, gs1, b256_end, c40_end, debug_print); + &b256_start, ¤t_mode, fncs, b256_end, c40_end, debug_print); } else { /* Do default minimal encodation */ error_number = dm_minimalenc(symbol, source, length, last_seg, &sp, target, &tp, process_buffer, &process_p, - &b256_start, ¤t_mode, gs1, debug_print); + &b256_start, ¤t_mode, fncs, debug_print); } if (error_number) { assert(error_number >= ZINT_ERROR); @@ -1571,7 +1552,7 @@ static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], c /* Backtrack to last complete triplet (same technique as BWIPP) */ while (sp > 0 && process_p % 3) { sp--; - cnt = dm_c40text_cnt(current_mode, gs1, source[sp]); + cnt = dm_c40text_cnt(current_mode, fncs[sp], source[sp]); total_cnt += cnt; process_p -= cnt; } @@ -1588,14 +1569,9 @@ static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], c target[tp++] = 235; /* FNC4 */ target[tp++] = (source[sp] - 128) + 1; if (debug_print) printf("FN4 A%02X ", target[tp - 1] - 1); - } else if (gs1 && source[sp] == '\x1D') { - if (gs1 == 2) { - target[tp++] = 29 + 1; /* GS */ - if (debug_print) fputs("GS ", stdout); - } else { - target[tp++] = 232; /* FNC1 */ - if (debug_print) fputs("FN1 ", stdout); - } + } else if (fncs[sp] && source[sp] == '\x1D') { + target[tp++] = 232; /* FNC1 */ + if (debug_print) fputs("FN1 ", stdout); } else { target[tp++] = source[sp] + 1; if (debug_print) printf("A%02X ", target[tp - 1] - 1); @@ -1670,10 +1646,10 @@ static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], c } #ifdef ZINT_TEST /* Wrapper for direct testing */ -INTERNAL int zint_test_dm_encode(struct zint_symbol *symbol, const unsigned char source[], const int length, - const int eci, const int last_seg, const int gs1, const int b256_end, const int c40_end, +INTERNAL int zint_test_dm_encode(struct zint_symbol *symbol, const unsigned char source[], int length, + const int eci, const int last_seg, const char *fncs, const int b256_end, const int c40_end, unsigned char target[], int *p_tp) { - return dm_encode(symbol, source, length, eci, last_seg, gs1, b256_end, c40_end, target, p_tp); + return dm_encode(symbol, source, length, eci, last_seg, fncs, b256_end, c40_end, target, p_tp); } #endif @@ -1685,10 +1661,12 @@ static int dm_encode_segs(struct zint_symbol *symbol, struct zint_seg segs[], co int i; int tp = 0; int in_macro = 0; + int have_extra_escapes = 0; int tot_length = 0, b256_have_fnc1 = 0; const struct zint_seg *last_seg = &segs[seg_count - 1]; /* gs1 flag values: 0: no GS1, 1: GS1 with FNC1 serparator, 2: GS separator */ const int gs1 = (symbol->input_mode & 0x07) == GS1_MODE ? 1 + !!(symbol->output_options & GS1_GS_SEPARATOR) : 0; + const int extra_escape_mode = symbol->input_mode & EXTRA_ESCAPE_MODE; const int mailmark = symbol->symbology == BARCODE_MAILMARK_2D; const int have_c40 = (symbol->option_3 & DM_C40_START) && symbol->option_1 >= 0; const int have_b256 = (symbol->option_3 & DM_B256_START) && symbol->option_1 >= 0; @@ -1757,6 +1735,14 @@ static int dm_encode_segs(struct zint_symbol *symbol, struct zint_seg segs[], co target[tp++] = id2; } + if (extra_escape_mode && (symbol->symbology != BARCODE_DATAMATRIX || gs1)) { + if (symbol->symbology != BARCODE_DATAMATRIX) { + return z_errtxt(ZINT_ERROR_INVALID_OPTION, symbol, 843, + "Can only use extra escape mode with non-variant Data Matrix"); + } + return z_errtxt(ZINT_ERROR_INVALID_OPTION, symbol, 844, "Cannot use extra escape mode in GS1 mode"); + } + if (gs1) { target[tp++] = 232; if (debug_print) fputs("FN1 ", stdout); @@ -1799,6 +1785,8 @@ static int dm_encode_segs(struct zint_symbol *symbol, struct zint_seg segs[], co for (i = 0; i < seg_count; i++) { const unsigned char *source; + unsigned char *src_buf; + char *fncs; int length; int src_inc = 0, len_dec = 0; int b256_end = 0, c40_end = 0; @@ -1813,6 +1801,29 @@ static int dm_encode_segs(struct zint_symbol *symbol, struct zint_seg segs[], co source = segs[i].source + src_inc; length = segs[i].length - len_dec; + src_buf = (unsigned char *) z_alloca(length + 1); + fncs = (char *) z_alloca(length); + + if (gs1) { + memset(fncs, gs1 == 1, length); + } else { + memset(fncs, 0, length); + if (extra_escape_mode) { + int len; + if ((error_number = z_extra_escapes(symbol, source, length, segs[i].eci, src_buf, fncs, &len))) { + return error_number; + } + if (len != length) { + assert(len < length); + length = len; + assert(length > 0); + src_buf[length] = '\0'; + source = src_buf; + have_extra_escapes = 1; + } + } + } + if (mailmark) { assert(seg_count == 1); assert(length >= 45); @@ -1834,6 +1845,7 @@ static int dm_encode_segs(struct zint_symbol *symbol, struct zint_seg segs[], co if (b256_have_fnc1) { b256_end = 0; } else { + int b256_len; if (symbol->option_1 == 0) { b256_end = length; } else if (symbol->option_1 < tot_length) { @@ -1841,21 +1853,27 @@ static int dm_encode_segs(struct zint_symbol *symbol, struct zint_seg segs[], co } else { b256_end = symbol->option_1 - tot_length < length ? symbol->option_1 - tot_length : length; } - if (gs1 == 1) { - /* Stop at first FNC1 */ - const int b256_len = b256_end; - for (b256_end = 0; b256_end < b256_len && source[b256_end] != '\x1D'; b256_end++); - b256_have_fnc1 = b256_end != b256_len; + /* Stop at first FNC1 */ + b256_len = b256_end; + for (b256_end = 0; b256_end < b256_len; b256_end++) { + if (fncs[b256_end] && source[b256_end] == '\x1D') { + break; + } } + b256_have_fnc1 = b256_end != b256_len; } } - if ((error_number = dm_encode(symbol, source, length, segs[i].eci, i + 1 == seg_count, gs1, b256_end, c40_end, - target, &tp))) { + if ((error_number = dm_encode(symbol, source, length, segs[i].eci, i + 1 == seg_count, fncs, b256_end, + c40_end, target, &tp))) { assert(error_number >= ZINT_ERROR); return error_number; } - if (content_segs && segs[i].eci) { - z_ct_set_seg_eci(symbol, i, segs[i].eci); + if (content_segs) { + if (have_extra_escapes) { + z_ct_set_seg_extra_escapes_eci(symbol, i, segs[i].eci); + } else if (segs[i].eci) { + z_ct_set_seg_eci(symbol, i, segs[i].eci); + } } tot_length += length; } diff --git a/backend/library.c b/backend/library.c index 40c9cf6f..c8626e8b 100644 --- a/backend/library.c +++ b/backend/library.c @@ -366,6 +366,12 @@ static int supports_non_iso8859_1(const int symbology) { return 0; } +/* 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); +} + /* Returns 1 if symbology supports HRT */ static int has_hrt(const int symbology) { @@ -720,7 +726,8 @@ static int escape_char_process(struct zint_symbol *symbol, const unsigned char * int val; int i; unsigned int unicode; - const int extra_escape_mode = (symbol->input_mode & EXTRA_ESCAPE_MODE) && symbol->symbology == BARCODE_CODE128; + const int extra_escape_mode = symbol->input_mode & EXTRA_ESCAPE_MODE; + const int can_extra_escape = supports_extra_escape_mode(symbol); const int escape_parens = (symbol->input_mode & GS1PARENS_MODE) && ((symbol->input_mode & 0x07) == GS1_MODE || check_force_gs1(symbol->symbology)); @@ -748,10 +755,14 @@ static int escape_char_process(struct zint_symbol *symbol, const unsigned char * if (escaped_string) escaped_string[out_posn] = vals[z_posn(escs, ch)]; in_posn += 2; break; - case '^': /* CODE128 specific */ - if (!extra_escape_mode) { - return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 798, - "Escape '\\^' only valid for Code 128 in extra escape mode"); + 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"); + } + return z_errtxt(ZINT_ERROR_INVALID_DATA, symbol, 213, + "Extra escape '\\^' not valid for this symbology and/or input mode"); } /* Pass thru unaltered */ if (escaped_string) { @@ -814,7 +825,7 @@ static int escape_char_process(struct zint_symbol *symbol, const unsigned char * } /* Exclude reversed BOM and surrogates and out-of-range */ if (unicode == 0xFFFE || (unicode >= 0xD800 && unicode < 0xE000) || unicode > 0x10FFFF) { - return z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 246, + return z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 216, "Value of escape sequence '%.*s' in input out of range", ch == 'u' ? 6 : 8, input_string + in_posn); } @@ -849,7 +860,8 @@ static int escape_char_process(struct zint_symbol *symbol, const unsigned char * break; default: return z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 234, - "Unrecognised escape character '\\%c' in input", ch); + "Unrecognised escape character '\\%c' in input", + !z_isascii(ch) || z_iscntrl(ch) ? '?' : ch); break; } } else { @@ -991,7 +1003,7 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[ } escape_mode = (symbol->input_mode & ESCAPE_MODE) - || ((symbol->input_mode & EXTRA_ESCAPE_MODE) && symbol->symbology == BARCODE_CODE128); + || ((symbol->input_mode & EXTRA_ESCAPE_MODE) && supports_extra_escape_mode(symbol)); content_segs = symbol->output_options & BARCODE_CONTENT_SEGS; local_segs = (struct zint_seg *) z_alloca(sizeof(struct zint_seg) * (seg_count > 0 ? seg_count : 1)); @@ -1074,7 +1086,7 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[ } if (total_len > ZINT_MAX_DATA_LEN) { - return error_tag(ZINT_ERROR_TOO_LONG, symbol, 243, "Input too long"); + return error_tag(ZINT_ERROR_TOO_LONG, symbol, 214, "Input too long"); } /* Reconcile symbol ECI and first segment ECI if both set */ @@ -1191,7 +1203,7 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[ if ((symbol->input_mode & 0x07) == UNICODE_MODE) { for (i = 0; i < seg_count; i++) { if (!z_is_valid_utf8(local_segs[i].source, local_segs[i].length)) { - return error_tag(ZINT_ERROR_INVALID_DATA, symbol, 245, "Invalid UTF-8 in input"); + return error_tag(ZINT_ERROR_INVALID_DATA, symbol, 215, "Invalid UTF-8 in input"); } } /* Only strip BOM on first segment */ @@ -1245,7 +1257,7 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[ return error_tag(ZINT_ERROR_INVALID_OPTION, symbol, 210, "Selected symbology does not support GS1 mode"); } } else if (content_segs && supports_non_iso8859_1(symbol->symbology)) { - /* Copy these as-is. The content seg `eci` will need to be updated individually */ + /* Copy these as-is. The content seg `eci` (& maybe `source`) will need to be updated individually */ if (z_ct_cpy_segs(symbol, local_segs, seg_count)) { return error_tag(ZINT_ERROR_MEMORY, symbol, -1, NULL); /* `z_ct_cpy_segs()` only fails with OOM */ } diff --git a/backend/libzint.rc b/backend/libzint.rc index dc22c5b3..b61c0d68 100644 --- a/backend/libzint.rc +++ b/backend/libzint.rc @@ -5,11 +5,7 @@ #define VER_FILEVERSION 2,16,0,9 #define VER_FILEVERSION_STR "2.16.0.9\0" -#ifdef GCC_WINDRES VS_VERSION_INFO VERSIONINFO -#else -VS_VERSION_INFO VERSIONINFO -#endif FILEVERSION VER_FILEVERSION PRODUCTVERSION VER_FILEVERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK @@ -24,13 +20,14 @@ FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN - BLOCK "040904E4" - //language ID = U.S. English, char set = Windows, Multilingual + BLOCK "040904B0" + //language ID = U.S. English, char set = Windows, Unicode BEGIN + VALUE "CompanyName", "Zint\0" VALUE "FileDescription", "libzint barcode library\0" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "zint.dll\0" - VALUE "LegalCopyright", "Copyright © 2025 Robin Stuart & BogDan Vatra\0" + VALUE "LegalCopyright", "Copyright © 2026 Robin Stuart & BogDan Vatra\0" VALUE "OriginalFilename", "zint.dll\0" VALUE "ProductName", "libzint\0" VALUE "ProductVersion", VER_FILEVERSION_STR @@ -40,6 +37,6 @@ BEGIN END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x0409, 1250 + VALUE "Translation", 0x0409, 1200 END END diff --git a/backend/tests/test_code128.c b/backend/tests/test_code128.c index 8222c717..2b820a50 100644 --- a/backend/tests/test_code128.c +++ b/backend/tests/test_code128.c @@ -204,83 +204,113 @@ static void test_hrt(const testCtx *const p_ctx) { int expected_length; const char *expected_content; int expected_content_length; + int bwipp_cmp; int zxingcpp_cmp; + const char *comment; }; /* Ă© U+00E9 (\351, 233), UTF-8 C3A9, CodeB-only extended ASCII */ /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ static const struct item data[] = { - /* 0*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "1234567890", -1, "1234567890", -1, "", -1, 1 }, - /* 1*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "1234567890", -1, "1234567890", -1, "1234567890", -1, 1 }, - /* 2*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "\000ABC\000DEF\000", 9, " ABC DEF ", -1, "", -1, 1 }, - /* 3*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "\000ABC\000DEF\000", 9, " ABC DEF ", -1, "\000ABC\000DEF\000", 9, 1 }, /* No replacements */ - /* 4*/ { BARCODE_CODE128AB, UNICODE_MODE, -1, -1, "12345\00067890", 11, "12345 67890", -1, "", -1, 1 }, - /* 5*/ { BARCODE_CODE128AB, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "12345\00067890", 11, "12345 67890", -1, "12345\00067890", 11, 1 }, - /* 6*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "12345\01167890\037\177", -1, "12345 67890 ", -1, "", -1, 1 }, - /* 7*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "12345\01167890\037\177", -1, "12345 67890 ", -1, "12345\01167890\037\177", -1, 1 }, - /* 8*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "abcdĂ©", -1, "abcdĂ©", -1, "", -1, 1 }, - /* 9*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "abcdĂ©", -1, "abcdĂ©", -1, "abcdĂ©", -1, 1 }, /* Now UTF-8, not converted */ - /* 10*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "abcdĂ©\302\240", -1, "abcdĂ©\302\240", -1, "", -1, 1 }, /* \302\240 (U+A0) NBSP */ - /* 11*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "abcdĂ©\302\240", -1, "abcdĂ©\302\240", -1, "abcdĂ©\302\240", -1, 1 }, - /* 12*/ { BARCODE_CODE128, DATA_MODE, -1, -1, "abcd\351", -1, "abcdĂ©", -1, "", -1, 899 }, - /* 13*/ { BARCODE_CODE128, DATA_MODE, -1, BARCODE_CONTENT_SEGS, "abcd\351", -1, "abcdĂ©", -1, "abcd\351", -1, 899 }, - /* 14*/ { BARCODE_CODE128, DATA_MODE, -1, -1, "ab\240cd\351", -1, "ab\302\240cdĂ©", -1, "", -1, 899 }, /* \240 (U+A0) NBSP */ - /* 15*/ { BARCODE_CODE128, DATA_MODE, -1, BARCODE_CONTENT_SEGS, "ab\240cd\351", -1, "ab\302\240cdĂ©", -1, "ab\240cd\351", -1, 899 }, - /* 16*/ { BARCODE_CODE128, DATA_MODE, -1, -1, "ab\200cd\351", -1, "ab cdĂ©", -1, "", -1, 899 }, /* \200 (U+80) non-ISO/IEC 8859-1 */ - /* 17*/ { BARCODE_CODE128, DATA_MODE, -1, BARCODE_CONTENT_SEGS, "ab\200cd\351", -1, "ab cdĂ©", -1, "ab\200cd\351", -1, 899 }, - /* 18*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C123456789012345678", -1, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678", -1, "", -1, 1 }, /* Max length 198 + 19 special escapes = 99 + 19*3 = 255 */ - /* 19*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C123456789012345678", -1, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678", -1, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678", -1, 1 }, - /* 20*/ { BARCODE_CODE128AB, UNICODE_MODE, -1, -1, "abcdĂ©", -1, "abcdĂ©", -1, "", -1, 1 }, - /* 21*/ { BARCODE_CODE128AB, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "abcdĂ©", -1, "abcdĂ©", -1, "abcdĂ©", -1, 1 }, - /* 22*/ { BARCODE_CODE128AB, DATA_MODE, -1, -1, "abcd\351", -1, "abcdĂ©", -1, "", -1, 899 }, - /* 23*/ { BARCODE_CODE128AB, DATA_MODE, -1, BARCODE_CONTENT_SEGS, "abcd\351", -1, "abcdĂ©", -1, "abcd\351", -1, 899 }, - /* 24*/ { BARCODE_HIBC_128, UNICODE_MODE, -1, -1, "1234567890", -1, "*+12345678900*", -1, "", -1, 1 }, - /* 25*/ { BARCODE_HIBC_128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "1234567890", -1, "*+12345678900*", -1, "+12345678900", -1, 1 }, - /* 26*/ { BARCODE_HIBC_128, UNICODE_MODE, -1, -1, "a99912345", -1, "*+A999123457*", -1, "", -1, 1 }, /* Converts to upper */ - /* 27*/ { BARCODE_HIBC_128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "a99912345", -1, "*+A999123457*", -1, "+A999123457", -1, 1 }, - /* 28*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "000393206219912345678101040", -1, "0003 932 0621 9912 3456 78 101 040 9", -1, "", -1, 1 }, /* DPDAPPD 4.0.2 - Illustration 7 */ - /* 29*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "000393206219912345678101040", -1, "0003 932 0621 9912 3456 78 101 040 9", -1, "%000393206219912345678101040", -1, 1 }, /* Includes '%', no spaces, no check digit */ - /* 30*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "007110601782532948375101276", -1, "0071 106 0178 2532 9483 75 101 276 X", -1, "", -1, 1 }, /* DPDAPPD 4.0.2 - Illustration 6, figure's HRT seems incorrect */ - /* 31*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "007110601782532948375101276", -1, "0071 106 0178 2532 9483 75 101 276 X", -1, "%007110601782532948375101276", -1, 1 }, - /* 32*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020028101276", -1, "0081 827 0998 0000 0200 28 101 276 B", -1, "", -1, 1 }, /* DPDPLS Section 4 */ - /* 33*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "008182709980000020028101276", -1, "0081 827 0998 0000 0200 28 101 276 B", -1, "%008182709980000020028101276", -1, 1 }, - /* 34*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "007110601632532948375179276", -1, "0071 106 0163 2532 9483 75 179 276 A", -1, "", -1, 1 }, /* DPDPLS Section 4.6 */ - /* 35*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "007110601632532948375179276", -1, "0071 106 0163 2532 9483 75 179 276 A", -1, "%007110601632532948375179276", -1, 1 }, - /* 36*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "001990009980000020084109203", -1, "0019 900 0998 0000 0200 84 109 203 1", -1, "", -1, 1 }, /* DPDPLS Section 5.1 */ - /* 37*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "001990009980000020084109203", -1, "0019 900 0998 0000 0200 84 109 203 1", -1, "%001990009980000020084109203", -1, 1 }, - /* 38*/ { BARCODE_DPD, UNICODE_MODE, 1, -1, "007110601632532948375101276", -1, "0071 106 0163 2532 9483 75 101 276 O", -1, "", -1, 1 }, /* DPDPLS Section 6.1.2 relabel, figure is actually 8.7.2 with mislabelled HRT */ - /* 39*/ { BARCODE_DPD, UNICODE_MODE, 1, BARCODE_CONTENT_SEGS, "007110601632532948375101276", -1, "0071 106 0163 2532 9483 75 101 276 O", -1, "007110601632532948375101276", -1, 1 }, /* No '%' */ - /* 40*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020029136276", -1, "0081 827 0998 0000 0200 29 136 276 3", -1, "", -1, 1 }, /* DPDPLS Section 8.1 */ - /* 41*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "001234509980000020031105276", -1, "0012 345 0998 0000 0200 31 105 276 L", -1, "", -1, 1 }, /* DPDPLS Section 8.2 */ - /* 42*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020032154276", -1, "0081 827 0998 0000 0200 32 154 276 J", -1, "", -1, 1 }, /* DPDPLS Section 8.3 */ - /* 43*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020030109276", -1, "0081 827 0998 0000 0200 30 109 276 W", -1, "", -1, 1 }, /* DPDPLS Section 8.4 */ - /* 44*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020033350276", -1, "0081 827 0998 0000 0200 33 350 276 C", -1, "", -1, 1 }, /* DPDPLS Section 8.5.1 */ - /* 45*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020034179276", -1, "0081 827 0998 0000 0200 34 179 276 I", -1, "", -1, 1 }, /* DPDPLS Section 8.5.2 */ - /* 46*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020035225276", -1, "0081 827 0998 0000 0200 35 225 276 H", -1, "", -1, 1 }, /* DPDPLS Section 8.5.3 */ - /* 47*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020036155276", -1, "0081 827 0998 0000 0200 36 155 276 5", -1, "", -1, 1 }, /* DPDPLS Section 8.5.4 */ - /* 48*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "000280009980000020037155056", -1, "0002 800 0998 0000 0200 37 155 056 6", -1, "", -1, 1 }, /* DPDPLS Section 8.5.5 */ - /* 49*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "007855009980000020041302840", -1, "0078 550 0998 0000 0200 41 302 840 U", -1, "", -1, 1 }, /* DPDPLS Section 8.5.6 */ - /* 50*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020042102276", -1, "0081 827 0998 0000 0200 42 102 276 R", -1, "", -1, 1 }, /* DPDPLS Section 8.6.1 */ - /* 51*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020043113276", -1, "0081 827 0998 0000 0200 43 113 276 Y", -1, "", -1, 1 }, /* DPDPLS Section 8.7.1 */ - /* 52*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "008182709980000020043113276", -1, "0081 827 0998 0000 0200 43 113 276 Y", -1, "%008182709980000020043113276", -1, 1 }, - /* 53*/ { BARCODE_DPD, UNICODE_MODE, 1, -1, "006376209980000020044118276", -1, "0063 762 0998 0000 0200 44 118 276 I", -1, "", -1, 1 }, /* DPDPLS Section 8.7.2 relabel */ - /* 54*/ { BARCODE_DPD, UNICODE_MODE, 1, BARCODE_CONTENT_SEGS, "006376209980000020044118276", -1, "0063 762 0998 0000 0200 44 118 276 I", -1, "006376209980000020044118276", -1, 1 }, - /* 55*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "007160009980000020050294276", -1, "0071 600 0998 0000 0200 50 294 276 C", -1, "", -1, 1 }, /* DPDPLS Section 8.8 */ - /* 56*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020045327276", -1, "0081 827 0998 0000 0200 45 327 276 N", -1, "", -1, 1 }, /* DPDPLS Section 8.9.1 */ - /* 57*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "006374309980000020047337276", -1, "0063 743 0998 0000 0200 47 337 276 O", -1, "", -1, 1 }, /* DPDPLS Section 8.9.2 */ - /* 58*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "006374309980000020047337276", -1, "0063 743 0998 0000 0200 47 337 276 O", -1, "%006374309980000020047337276", -1, 1 }, - /* 59*/ { BARCODE_DPD, UNICODE_MODE, 1, -1, "006374109980978004757332276", -1, "0063 741 0998 0978 0047 57 332 276 M", -1, "", -1, 1 }, /* DPDPLS Section 8.9.3 relabel, figure's HRT seems incorrect */ - /* 60*/ { BARCODE_DPD, UNICODE_MODE, 1, BARCODE_CONTENT_SEGS, "006374109980978004757332276", -1, "0063 741 0998 0978 0047 57 332 276 M", -1, "006374109980978004757332276", -1, 1 }, - /* 61*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020051106276", -1, "0081 827 0998 0000 0200 51 106 276 M", -1, "", -1, 1 }, /* DPDPLS Section 9.1 */ - /* 62*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020052110276", -1, "0081 827 0998 0000 0200 52 110 276 W", -1, "", -1, 1 }, /* DPDPLS Section 9.2 */ - /* 63*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020053161276", -1, "0081 827 0998 0000 0200 53 161 276 O", -1, "", -1, 1 }, /* DPDPLS Section 9.3 */ - /* 64*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020054352276", -1, "0081 827 0998 0000 0200 54 352 276 B", -1, "", -1, 1 }, /* DPDPLS Section 9.4 */ - /* 65*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020055191276", -1, "0081 827 0998 0000 0200 55 191 276 A", -1, "", -1, 1 }, /* DPDPLS Section 9.5 */ - /* 66*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020056237276", -1, "0081 827 0998 0000 0200 56 237 276 K", -1, "", -1, 1 }, /* DPDPLS Section 9.6 */ - /* 67*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "008182709980000020056237276", -1, "0081 827 0998 0000 0200 56 237 276 K", -1, "%008182709980000020056237276", -1, 1 }, - /* 68*/ { BARCODE_UPU_S10, UNICODE_MODE, -1, -1, "EE876543216CA", -1, "EE 876 543 216 CA", -1, "", -1, 1 }, /* UPU S10 Annex A */ - /* 69*/ { BARCODE_UPU_S10, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "EE876543216CA", -1, "EE 876 543 216 CA", -1, "EE876543216CA", -1, 1 }, /* No spaces */ + /* 0*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "1234567890", -1, "1234567890", -1, "", -1, 1, 1, "" }, + /* 1*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "1234567890", -1, "1234567890", -1, "1234567890", -1, 1, 1, "" }, + /* 2*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "\000ABC\000DEF\000", 9, " ABC DEF ", -1, "", -1, 1, 1, "" }, + /* 3*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "\000ABC\000DEF\000", 9, " ABC DEF ", -1, "\000ABC\000DEF\000", 9, 1, 1, "No replacements" }, + /* 4*/ { BARCODE_CODE128AB, UNICODE_MODE, -1, -1, "12345\00067890", 11, "12345 67890", -1, "", -1, 1, 1, "" }, + /* 5*/ { BARCODE_CODE128AB, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "12345\00067890", 11, "12345 67890", -1, "12345\00067890", 11, 1, 1, "" }, + /* 6*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "12345\01167890\037\177", -1, "12345 67890 ", -1, "", -1, 1, 1, "" }, + /* 7*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "12345\01167890\037\177", -1, "12345 67890 ", -1, "12345\01167890\037\177", -1, 1, 1, "" }, + /* 8*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "abcdĂ©", -1, "abcdĂ©", -1, "", -1, 1, 1, "" }, + /* 9*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "abcdĂ©", -1, "abcdĂ©", -1, "abcdĂ©", -1, 1, 1, "Now UTF-8, not converted" }, + /* 10*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, "abcdĂ©\302\240", -1, "abcdĂ©\302\240", -1, "", -1, 1, 1, "\302\240 (U+A0) NBSP" }, + /* 11*/ { BARCODE_CODE128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "abcdĂ©\302\240", -1, "abcdĂ©\302\240", -1, "abcdĂ©\302\240", -1, 1, 1, "" }, + /* 12*/ { BARCODE_CODE128, DATA_MODE, -1, -1, "abcd\351", -1, "abcdĂ©", -1, "", -1, 1, 899, "" }, + /* 13*/ { BARCODE_CODE128, DATA_MODE, -1, BARCODE_CONTENT_SEGS, "abcd\351", -1, "abcdĂ©", -1, "abcd\351", -1, 1, 899, "" }, + /* 14*/ { BARCODE_CODE128, DATA_MODE, -1, -1, "ab\240cd\351", -1, "ab\302\240cdĂ©", -1, "", -1, 1, 899, "\240 (U+A0) NBSP" }, + /* 15*/ { BARCODE_CODE128, DATA_MODE, -1, BARCODE_CONTENT_SEGS, "ab\240cd\351", -1, "ab\302\240cdĂ©", -1, "ab\240cd\351", -1, 1, 899, "" }, + /* 16*/ { BARCODE_CODE128, DATA_MODE, -1, -1, "ab\200cd\351", -1, "ab cdĂ©", -1, "", -1, 1, 899, "\200 (U+80) non-ISO/IEC 8859-1" }, + /* 17*/ { BARCODE_CODE128, DATA_MODE, -1, BARCODE_CONTENT_SEGS, "ab\200cd\351", -1, "ab cdĂ©", -1, "ab\200cd\351", -1, 1, 899, "" }, + /* 18*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C123456789012345678", -1, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678", -1, "", -1, 1, 1, "Max length 198 + 19 special escapes = 99 + 19*3 = 255" }, + /* 19*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C1234567890\\^C123456789012345678", -1, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678", -1, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678", -1, 1, 1, "" }, + /* 20*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "\\^10412345", -1, "0412345", -1, "", -1, 1, 1, "" }, + /* 21*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^10412345", -1, "0412345", -1, "0412345", -1, 1, 1, "" }, + /* 22*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "\\^1\\^1041234\\^15", -1, "0412345", -1, "", -1, 0, 1, "BWIPP: different encodation (same no. of codewords) - see below (forced mode)" }, + /* 23*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^1\\^1041234\\^15", -1, "0412345", -1, "\035041234\0355", -1, 0, 1, "BWIPP - see below (forced mode)" }, + /* 24*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "\\^1\\^1041234\\^B\\^15", -1, "0412345", -1, "", -1, 1, 1, "" }, + /* 25*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^1\\^1041234\\^B\\^15", -1, "0412345", -1, "\035041234\0355", -1, 1, 1, "" }, + /* 26*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "A\\^1123456", -1, "A123456", -1, "", -1, 1, 1, "" }, + /* 27*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "A\\^1123456", -1, "A123456", -1, "A123456", -1, 1, 1, "" }, + /* 28*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "A\\^1123456\\^1", -1, "A123456", -1, "", -1, 1, 1, "" }, + /* 29*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "A\\^1123456\\^1", -1, "A123456", -1, "A123456\035", -1, 1, 1, "" }, + /* 30*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "?\\^1123456\\^1", -1, "?123456", -1, "", -1, 0, 1, "BWIPP: different encodation (same no. of codewords) - see below (forced mode)" }, + /* 31*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "?\\^1123456\\^1", -1, "?123456", -1, "?\035123456\035", -1, 0, 1, "BWIPP - see below (forced mode)" }, + /* 32*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "?\\^B\\^1\\^@123456\\^1", -1, "?123456", -1, "", -1, 1, 1, "" }, + /* 33*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "?\\^B\\^1\\^@123456\\^1", -1, "?123456", -1, "?\035123456\035", -1, 1, 1, "" }, + /* 34*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "12\\^1123456", -1, "12123456", -1, "", -1, 1, 1, "" }, + /* 35*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "12\\^1123456", -1, "12123456", -1, "12123456", -1, 1, 1, "" }, + /* 36*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "12\\^1\\^1123456", -1, "12123456", -1, "", -1, 1, 1, "" }, + /* 37*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "12\\^1\\^1123456", -1, "12123456", -1, "12\035123456", -1, 1, 1, "" }, + /* 38*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "\\^C12\\^1\\^1123456", -1, "12123456", -1, "", -1, 1, 1, "" }, + /* 39*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^C12\\^1\\^1123456", -1, "12123456", -1, "12\035123456", -1, 1, 1, "" }, + /* 40*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "1A\\^1123456", -1, "1A123456", -1, "", -1, 0, 1, "BWIPP: different encodation (same no. of codewords)" }, + /* 41*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "1A\\^1123456", -1, "1A123456", -1, "1A\035123456", -1, 0, 1, "BWIPP: as above" }, + /* 42*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "\\^1\\^1", -1, "", -1, "", -1, 0, 1, "BWIPP: different encodation (same no. of codewords) - see below (forced mode)" }, + /* 43*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^1\\^1", -1, "", -1, "\035", -1, 0, 1, "BWIPP - see below (forced mode)" }, + /* 44*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "\\^B\\^1\\^1", -1, "", -1, "", -1, 1, 1, "" }, + /* 45*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^B\\^1\\^1", -1, "", -1, "\035", -1, 1, 1, "" }, + /* 46*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, -1, "\\^1\\^1\\^1", -1, "", -1, "", -1, 0, 1, "BWIPP: different encodation (same no. of codewords)" }, + /* 47*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^1\\^1\\^1", -1, "", -1, "\035\035", -1, 0, 1, "BWIPP: as above" }, + /* 48*/ { BARCODE_CODE128AB, UNICODE_MODE, -1, -1, "abcdĂ©", -1, "abcdĂ©", -1, "", -1, 1, 1, "" }, + /* 49*/ { BARCODE_CODE128AB, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "abcdĂ©", -1, "abcdĂ©", -1, "abcdĂ©", -1, 1, 1, "" }, + /* 50*/ { BARCODE_CODE128AB, DATA_MODE, -1, -1, "abcd\351", -1, "abcdĂ©", -1, "", -1, 1, 899, "" }, + /* 51*/ { BARCODE_CODE128AB, DATA_MODE, -1, BARCODE_CONTENT_SEGS, "abcd\351", -1, "abcdĂ©", -1, "abcd\351", -1, 1, 899, "" }, + /* 52*/ { BARCODE_HIBC_128, UNICODE_MODE, -1, -1, "1234567890", -1, "*+12345678900*", -1, "", -1, 1, 1, "" }, + /* 53*/ { BARCODE_HIBC_128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "1234567890", -1, "*+12345678900*", -1, "+12345678900", -1, 1, 1, "" }, + /* 54*/ { BARCODE_HIBC_128, UNICODE_MODE, -1, -1, "a99912345", -1, "*+A999123457*", -1, "", -1, 1, 1, "Converts to upper" }, + /* 55*/ { BARCODE_HIBC_128, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "a99912345", -1, "*+A999123457*", -1, "+A999123457", -1, 1, 1, "" }, + /* 56*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "000393206219912345678101040", -1, "0003 932 0621 9912 3456 78 101 040 9", -1, "", -1, 1, 1, "DPDAPPD 4.0.2 - Illustration 7" }, + /* 57*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "000393206219912345678101040", -1, "0003 932 0621 9912 3456 78 101 040 9", -1, "%000393206219912345678101040", -1, 1, 1, "Includes '%', no spaces, no check digit" }, + /* 58*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "007110601782532948375101276", -1, "0071 106 0178 2532 9483 75 101 276 X", -1, "", -1, 1, 1, "DPDAPPD 4.0.2 - Illustration 6, figure's HRT seems incorrect" }, + /* 59*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "007110601782532948375101276", -1, "0071 106 0178 2532 9483 75 101 276 X", -1, "%007110601782532948375101276", -1, 1, 1, "" }, + /* 60*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020028101276", -1, "0081 827 0998 0000 0200 28 101 276 B", -1, "", -1, 1, 1, "DPDPLS Section 4" }, + /* 61*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "008182709980000020028101276", -1, "0081 827 0998 0000 0200 28 101 276 B", -1, "%008182709980000020028101276", -1, 1, 1, "" }, + /* 62*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "007110601632532948375179276", -1, "0071 106 0163 2532 9483 75 179 276 A", -1, "", -1, 1, 1, "DPDPLS Section 4.6" }, + /* 63*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "007110601632532948375179276", -1, "0071 106 0163 2532 9483 75 179 276 A", -1, "%007110601632532948375179276", -1, 1, 1, "" }, + /* 64*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "001990009980000020084109203", -1, "0019 900 0998 0000 0200 84 109 203 1", -1, "", -1, 1, 1, "DPDPLS Section 5.1" }, + /* 65*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "001990009980000020084109203", -1, "0019 900 0998 0000 0200 84 109 203 1", -1, "%001990009980000020084109203", -1, 1, 1, "" }, + /* 66*/ { BARCODE_DPD, UNICODE_MODE, 1, -1, "007110601632532948375101276", -1, "0071 106 0163 2532 9483 75 101 276 O", -1, "", -1, 1, 1, "DPDPLS Section 6.1.2 relabel, figure is actually 8.7.2 with mislabelled HRT" }, + /* 67*/ { BARCODE_DPD, UNICODE_MODE, 1, BARCODE_CONTENT_SEGS, "007110601632532948375101276", -1, "0071 106 0163 2532 9483 75 101 276 O", -1, "007110601632532948375101276", -1, 1, 1, "No '%'" }, + /* 68*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020029136276", -1, "0081 827 0998 0000 0200 29 136 276 3", -1, "", -1, 1, 1, "DPDPLS Section 8.1" }, + /* 69*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "001234509980000020031105276", -1, "0012 345 0998 0000 0200 31 105 276 L", -1, "", -1, 1, 1, "DPDPLS Section 8.2" }, + /* 70*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020032154276", -1, "0081 827 0998 0000 0200 32 154 276 J", -1, "", -1, 1, 1, "DPDPLS Section 8.3" }, + /* 71*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020030109276", -1, "0081 827 0998 0000 0200 30 109 276 W", -1, "", -1, 1, 1, "DPDPLS Section 8.4" }, + /* 72*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020033350276", -1, "0081 827 0998 0000 0200 33 350 276 C", -1, "", -1, 1, 1, "DPDPLS Section 8.5.1" }, + /* 73*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020034179276", -1, "0081 827 0998 0000 0200 34 179 276 I", -1, "", -1, 1, 1, "DPDPLS Section 8.5.2" }, + /* 74*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020035225276", -1, "0081 827 0998 0000 0200 35 225 276 H", -1, "", -1, 1, 1, "DPDPLS Section 8.5.3" }, + /* 75*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020036155276", -1, "0081 827 0998 0000 0200 36 155 276 5", -1, "", -1, 1, 1, "DPDPLS Section 8.5.4" }, + /* 76*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "000280009980000020037155056", -1, "0002 800 0998 0000 0200 37 155 056 6", -1, "", -1, 1, 1, "DPDPLS Section 8.5.5" }, + /* 77*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "007855009980000020041302840", -1, "0078 550 0998 0000 0200 41 302 840 U", -1, "", -1, 1, 1, "DPDPLS Section 8.5.6" }, + /* 78*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020042102276", -1, "0081 827 0998 0000 0200 42 102 276 R", -1, "", -1, 1, 1, "DPDPLS Section 8.6.1" }, + /* 79*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020043113276", -1, "0081 827 0998 0000 0200 43 113 276 Y", -1, "", -1, 1, 1, "DPDPLS Section 8.7.1" }, + /* 80*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "008182709980000020043113276", -1, "0081 827 0998 0000 0200 43 113 276 Y", -1, "%008182709980000020043113276", -1, 1, 1, "" }, + /* 81*/ { BARCODE_DPD, UNICODE_MODE, 1, -1, "006376209980000020044118276", -1, "0063 762 0998 0000 0200 44 118 276 I", -1, "", -1, 1, 1, "DPDPLS Section 8.7.2 relabel" }, + /* 82*/ { BARCODE_DPD, UNICODE_MODE, 1, BARCODE_CONTENT_SEGS, "006376209980000020044118276", -1, "0063 762 0998 0000 0200 44 118 276 I", -1, "006376209980000020044118276", -1, 1, 1, "" }, + /* 83*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "007160009980000020050294276", -1, "0071 600 0998 0000 0200 50 294 276 C", -1, "", -1, 1, 1, "DPDPLS Section 8.8" }, + /* 84*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020045327276", -1, "0081 827 0998 0000 0200 45 327 276 N", -1, "", -1, 1, 1, "DPDPLS Section 8.9.1" }, + /* 85*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "006374309980000020047337276", -1, "0063 743 0998 0000 0200 47 337 276 O", -1, "", -1, 1, 1, "DPDPLS Section 8.9.2" }, + /* 86*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "006374309980000020047337276", -1, "0063 743 0998 0000 0200 47 337 276 O", -1, "%006374309980000020047337276", -1, 1, 1, "" }, + /* 87*/ { BARCODE_DPD, UNICODE_MODE, 1, -1, "006374109980978004757332276", -1, "0063 741 0998 0978 0047 57 332 276 M", -1, "", -1, 1, 1, "DPDPLS Section 8.9.3 relabel, figure's HRT seems incorrect" }, + /* 88*/ { BARCODE_DPD, UNICODE_MODE, 1, BARCODE_CONTENT_SEGS, "006374109980978004757332276", -1, "0063 741 0998 0978 0047 57 332 276 M", -1, "006374109980978004757332276", -1, 1, 1, "" }, + /* 89*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020051106276", -1, "0081 827 0998 0000 0200 51 106 276 M", -1, "", -1, 1, 1, "DPDPLS Section 9.1" }, + /* 90*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020052110276", -1, "0081 827 0998 0000 0200 52 110 276 W", -1, "", -1, 1, 1, "DPDPLS Section 9.2" }, + /* 91*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020053161276", -1, "0081 827 0998 0000 0200 53 161 276 O", -1, "", -1, 1, 1, "DPDPLS Section 9.3" }, + /* 92*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020054352276", -1, "0081 827 0998 0000 0200 54 352 276 B", -1, "", -1, 1, 1, "DPDPLS Section 9.4" }, + /* 93*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020055191276", -1, "0081 827 0998 0000 0200 55 191 276 A", -1, "", -1, 1, 1, "DPDPLS Section 9.5" }, + /* 94*/ { BARCODE_DPD, UNICODE_MODE, -1, -1, "008182709980000020056237276", -1, "0081 827 0998 0000 0200 56 237 276 K", -1, "", -1, 1, 1, "DPDPLS Section 9.6" }, + /* 95*/ { BARCODE_DPD, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "008182709980000020056237276", -1, "0081 827 0998 0000 0200 56 237 276 K", -1, "%008182709980000020056237276", -1, 1, 1, "" }, + /* 96*/ { BARCODE_UPU_S10, UNICODE_MODE, -1, -1, "EE876543216CA", -1, "EE 876 543 216 CA", -1, "", -1, 1, 1, "UPU S10 Annex A" }, + /* 97*/ { BARCODE_UPU_S10, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "EE876543216CA", -1, "EE 876 543 216 CA", -1, "EE876543216CA", -1, 1, 1, "No spaces" }, /* BARCODE_GS1_128, BARCODE_EAN14, BARCODE_NVE18 hrt tested in test_gs1.c */ }; const int data_size = ARRAY_SIZE(data); @@ -319,9 +349,9 @@ static void test_hrt(const testCtx *const p_ctx) { ret = ZBarcode_Encode(symbol, TCU(data[i].data), length); assert_zero(ret, "i:%d ZBarcode_Encode ret %d != 0 %s\n", i, ret, symbol->errtxt); - assert_equal(symbol->text_length, expected_length, "i:%d text_length %d != expected_length %d\n", - i, symbol->text_length, expected_length); - assert_zero(memcmp(symbol->text, data[i].expected, expected_length), "i:%d memcmp(%s, %s, %d) != 0\n", + assert_equal(symbol->text_length, expected_length, "i:%d text_length %d != expected_length %d (%s, %s)\n", + i, symbol->text_length, expected_length, symbol->text, data[i].expected); + assert_zero(memcmp(symbol->text, data[i].expected, expected_length), "i:%d text memcmp(%s, %s, %d) != 0\n", i, symbol->text, data[i].expected, expected_length); if (ret < ZINT_ERROR) { @@ -329,10 +359,11 @@ static void test_hrt(const testCtx *const p_ctx) { assert_nonnull(symbol->content_segs, "i:%d content_segs NULL\n", i); assert_nonnull(symbol->content_segs[0].source, "i:%d content_segs[0].source NULL\n", i); assert_equal(symbol->content_segs[0].length, expected_content_length, - "i:%d content_segs[0].length %d != expected_content_length %d\n", - i, symbol->content_segs[0].length, expected_content_length); + "i:%d content_segs[0].length %d != expected_content_length %d (%.*s, %s)\n", + i, symbol->content_segs[0].length, expected_content_length, + symbol->content_segs[0].length, symbol->content_segs[0].source, data[i].expected_content); assert_zero(memcmp(symbol->content_segs[0].source, data[i].expected_content, expected_content_length), - "i:%d memcmp(%.*s, %s, %d) != 0\n", + "i:%d content_segs memcmp(%.*s, %s, %d) != 0\n", i, symbol->content_segs[0].length, symbol->content_segs[0].source, data[i].expected_content, expected_content_length); } else { @@ -340,7 +371,12 @@ static void test_hrt(const testCtx *const p_ctx) { } if (do_bwipp && testUtilCanBwipp(i, symbol, -1, data[i].option_2, -1, debug)) { - if (data[i].symbology == BARCODE_HIBC_128 + if (!data[i].bwipp_cmp) { + if (debug & ZINT_DEBUG_TEST_PRINT) { + printf("i:%d %s not BWIPP compatible (%s)\n", + i, testUtilBarcodeName(symbol->symbology), data[i].comment); + } + } else if (data[i].symbology == BARCODE_HIBC_128 && z_not_sane(IS_NUM_F | IS_UPR_F | IS_SPC_F | IS_PLS_F | IS_MNS_F | IS_SIL_F, ZCUCP(data[i].data), length)) { if (debug & ZINT_DEBUG_TEST_PRINT) { printf("i:%d %s not BWIPP compatible (%s)\n", @@ -363,6 +399,7 @@ static void test_hrt(const testCtx *const p_ctx) { if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[4096]; + assert_nonzero(data[i].zxingcpp_cmp, "i:%d data[i].zxingcpp_cmp == 0", i); assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, data[i].zxingcpp_cmp, cmp_buf, @@ -512,8 +549,8 @@ static void test_input(const testCtx *const p_ctx) { /* 2*/ { UNICODE_MODE, "AIM1234", -1, 0, 101, 1, 1, "(9) 104 33 41 45 99 12 34 87 106", "Example from Annex A.1, check char value 87" }, /* 3*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, "123456789", -1, 0, 101, 1, 1, "(9) 105 12 34 56 78 100 25 79 106", "Ticket #204 ZPL example" }, /* 4*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, "\\^B12345\\^C6789", -1, 0, 123, 0, 1, "(11) 104 17 18 19 20 21 99 67 89 11 106", "Ticket #204 ZPL example; BWIPP as above" }, - /* 5*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, "\\^B12345\\^D6789", -1, 0, 167, 0, 1, "(15) 104 17 18 19 20 21 60 62 36 22 23 24 25 1 106", "Unrecognized extra escape passed thru; BWIPP different encodation" }, - /* 6*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, "\\^B12345\\^D6789", -1, 0, 167, 0, 1, "(15) 104 17 18 19 20 21 60 62 36 22 23 24 25 1 106", "Unrecognized extra escape passed thru; BWIPP different encodation" }, + /* 5*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, "\\^B12345\\^D6789", -1, ZINT_ERROR_INVALID_DATA, 0, 1, 1, "Error 348: Unrecognized extra escape \"\\^D\"", "" }, + /* 6*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, "\\^B12345\\^\0016789", -1, ZINT_ERROR_INVALID_DATA, 0, 1, 1, "Error 348: Unrecognized extra escape \"\\^?\"", "" }, /* 7*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, "\\^A\\^B\\^C", -1, ZINT_ERROR_INVALID_DATA, 0, 1, 1, "Error 842: No input data", "" }, /* 8*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, "\\^A\\^^B\\^C", -1, 0, 68, 0, 1, "(6) 103 60 62 34 80 106", "BWIPP different encodation" }, /* 9*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, "\\^A\\^B\\^^C", -1, 0, 68, 1, 1, "(6) 104 60 62 35 84 106", "" }, @@ -649,10 +686,10 @@ static void test_input(const testCtx *const p_ctx) { /*139*/ { UNICODE_MODE, "12Ă©12Ă©", -1, 0, 123, 0, 1, "(11) 105 12 100 100 73 17 18 100 73 17 106", "StartC 12 CodeB FNC4 Ă© 1 2 FNC4 Ă©; BWIPP different encodation (StartB)" }, /*140*/ { UNICODE_MODE, "1234Ă©123456Ă©", -1, 0, 167, 1, 1, "(15) 105 12 34 100 100 73 99 12 34 56 100 100 73 15 106", "StartC 12 34 CodeB FNC4 Ă© CodeC 12 34 56 CodeB FNC4 Ă©" }, /*141*/ { DATA_MODE, "\256^a\357\033\270\017,\274u$B\305\311\006\011]\273\025u\315\2638\263\333", -1, 0, 453, 1, 899, "(41) 104 100 14 62 65 100 79 101 91 101 24 79 12 101 28 98 85 4 34 101 37 101 41 70 73 61", "" }, - /*142*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^C\\^1", -1, 0, 46, 0, 0, "(4) 105 102 1 106", "StartC FNC1; From fuzz 2026-01-12; BWIPP see below; zxing-cpp empty text" }, - /*143*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^A\\^1", -1, 0, 46, 0, 0, "(4) 103 102 102 106", "StartA FNC1; From fuzz 2026-01-12; BWIPP see below; zxing-cpp empty text" }, - /*144*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^B\\^1", -1, 0, 46, 1, 0, "(4) 104 102 0 106", "StartB FNC1; From fuzz 2026-01-12; zxing-cpp empty text" }, - /*145*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^1", -1, 0, 46, 0, 0, "(4) 105 102 1 106", "StartC FNC1; BWIPP see above; zxing-cpp empty text" }, + /*142*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^C\\^1", -1, 0, 46, 0, 1, "(4) 105 102 1 106", "StartC FNC1; From fuzz 2026-01-12; BWIPP see below" }, + /*143*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^A\\^1", -1, 0, 46, 0, 1, "(4) 103 102 102 106", "StartA FNC1; From fuzz 2026-01-12; BWIPP see below" }, + /*144*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^B\\^1", -1, 0, 46, 1, 1, "(4) 104 102 0 106", "StartB FNC1; From fuzz 2026-01-12" }, + /*145*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^1", -1, 0, 46, 0, 1, "(4) 105 102 1 106", "StartC FNC1; BWIPP see above" }, /*146*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^C\\^1A", -1, 0, 68, 0, 3, "(6) 105 102 100 33 94 106", "StartC CodeB FNC1 A; BWIPP see below" }, /*147*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^A\\^1A", -1, 0, 57, 0, 3, "(5) 103 102 33 65 106", "StartA FNC1 A; BWIPP see below" }, /*148*/ { DATA_MODE | EXTRA_ESCAPE_MODE, "\\^B\\^1A", -1, 0, 57, 1, 3, "(5) 104 102 33 66 106", "StartB FNC1 A" }, diff --git a/backend/tests/test_common.c b/backend/tests/test_common.c index 5ba70ebc..ad6e5786 100644 --- a/backend/tests/test_common.c +++ b/backend/tests/test_common.c @@ -155,8 +155,7 @@ static void test_to_upper(const testCtx *const p_ctx) { buf[length] = '\0'; z_to_upper(buf, length); - assert_zero(strcmp((const char *) buf, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", - i, buf, data[i].expected); + assert_zero(strcmp(ZCCP(buf), data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, buf, data[i].expected); } testFinish(); @@ -764,6 +763,70 @@ static void test_utf8_to_unicode(const testCtx *const p_ctx) { testFinish(); } +static void test_extra_escapes(const testCtx *const p_ctx) { + int debug = p_ctx->debug; + + struct item { + int eci; + const char *data; + int length; + int ret; + const char *expected; + const char expected_fncs[32]; + const char *comment; + }; + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ + static const struct item data[] = { + /* 0*/ { 0, "", -1, 0, "", {0}, "" }, + /* 1*/ { 3, "ABC", -1, 0, "ABC", {0}, "" }, + /* 2*/ { 4, "\\^1ABC", -1, 0, "\035ABC", {1}, "" }, + /* 3*/ { 26, "\\^1\\^1A\\^1BC\\^1", -1, 0, "\035\035A\035BC\035", {1,1,0,1,0,0,1}, "" }, + /* 4*/ { 27, "\\^^\\^1A\\^1BC\\^^1", -1, 0, "\\^\035A\035BC\\^1", {0,0,1,0,1}, "" }, + /* 5*/ { 20, "ABC", -1, ZINT_ERROR_INVALID_OPTION, "", {0}, "" }, + /* 6*/ { 25, "ABC", -1, ZINT_ERROR_INVALID_OPTION, "", {0}, "" }, + /* 7*/ { 28, "ABC", -1, ZINT_ERROR_INVALID_OPTION, "", {0}, "" }, + /* 8*/ { 29, "ABC", -1, ZINT_ERROR_INVALID_OPTION, "", {0}, "" }, + /* 9*/ { 899, "ABC", -1, ZINT_ERROR_INVALID_OPTION, "", {0}, "" }, + }; + const int data_size = ARRAY_SIZE(data); + int i, length, ret; + + struct zint_symbol s_symbol; + struct zint_symbol *symbol = &s_symbol; + int expected_length; + + testStart(p_ctx->func_name); + + symbol->debug = debug; + + for (i = 0; i < data_size; i++) { + int len = 0; + unsigned char dest[32] = {0}; + char fncs[32] = {0}; + + if (testContinue(p_ctx, i)) continue; + + memset(symbol, 0, sizeof(*symbol)); + + length = data[i].length == -1 ? (int) strlen(data[i].data) : data[i].length; + expected_length = (int) strlen(data[i].expected); + assert_nonzero(expected_length < (int) sizeof(dest), "i:%d expected_length %d >= sizeof(dest) %d\n", + i, expected_length, (int) sizeof(dest)); + + ret = z_extra_escapes(symbol, ZCUCP(data[i].data), length, data[i].eci, dest, fncs, &len); + assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret); + if (ret < ZINT_ERROR) { + assert_equal(len, expected_length, "i:%d len %d != expected_length %d (%s)\n", + i, len, expected_length, dest); + assert_zero(strcmp(ZCCP(dest), data[i].expected), "i:%d dest (%s) != expected (%s)\n", + i, dest, data[i].expected); + assert_zero(memcmp(fncs, data[i].expected_fncs, expected_length), "i:%d fncs != expected_fncs\n", i); + } + } + + testFinish(); +} + /* Note transferred from "test_code128.c" */ static void test_hrt_cpy_iso8859_1(const testCtx *const p_ctx) { int debug = p_ctx->debug; @@ -1033,7 +1096,7 @@ static void test_hrt_printf_nochk(const testCtx *const p_ctx) { assert_zero(1, "i:%d, bad num_args\n", i); } - assert_zero(strcmp((const char *) symbol->text, data[i].expected), "i:%d strcmp(\"%s\", \"%s\") != 0\n", + assert_zero(strcmp(ZCCP(symbol->text), data[i].expected), "i:%d strcmp(\"%s\", \"%s\") != 0\n", i, symbol->text, data[i].expected); } @@ -1084,7 +1147,7 @@ static void test_hrt_conv_gs1_brackets_nochk(const testCtx *const p_ctx) { z_hrt_conv_gs1_brackets_nochk(symbol, TCU(data[i].data), length); - assert_zero(strcmp((const char *) symbol->text, data[i].expected), "i:%d strcmp(\"%s\", \"%s\") != 0\n", + assert_zero(strcmp(ZCCP(symbol->text), data[i].expected), "i:%d strcmp(\"%s\", \"%s\") != 0\n", i, symbol->text, data[i].expected); } @@ -1223,7 +1286,7 @@ static void test_ct_cpy(const testCtx *const p_ctx) { i, symbol->content_segs[0].length, expected_length); assert_zero(memcmp(symbol->content_segs[0].source, data[i].expected, expected_length), "i:%d content_segs[0].source memcmp(%s, %s, %d) != 0\n", i, - testUtilEscape((const char *) symbol->content_segs[0].source, symbol->content_segs[0].length, + testUtilEscape(ZCCP(symbol->content_segs[0].source), symbol->content_segs[0].length, escaped, sizeof(escaped)), testUtilEscape(data[i].expected, expected_length, escaped2, sizeof(escaped2)), expected_length); @@ -1237,6 +1300,81 @@ static void test_ct_cpy(const testCtx *const p_ctx) { testFinish(); } +static void test_ct_set_seg_extra_escapes_eci(const testCtx *const p_ctx) { + int debug = p_ctx->debug; + + struct item { + int seg_idx; + int seg_count; + int eci; + struct zint_seg segs[3]; + + struct zint_seg expected_content_segs[3]; + }; + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ + static const struct item data[] = { + /* 0*/ { 0, 1, 3, { { TU("\\^1A"), 0, 0 } }, { { TU("\035A"), 2, 3 } } }, + /* 1*/ { 0, 1, 0, { { TU("\\^1A"), 0, 0 } }, { { TU("A"), 1, 3 } } }, + /* 2*/ { 0, 1, 4, { { TU("A\\^1"), 0, 0 } }, { { TU("A\035"), 2, 4 } } }, + /* 3*/ { 0, 1, 0, { { TU("A\\^1"), 0, 0 } }, { { TU("A"), 1, 3 } } }, + /* 4*/ { 0, 1, 0, { { TU("a\\^1"), 0, 0 } }, { { TU("a"), 1, 3 } } }, + /* 5*/ { 0, 1, 0, { { TU("12\\^1"), 0, 0 } }, { { TU("12"), 2, 3 } } }, + /* 6*/ { 0, 1, 0, { { TU("?\\^1"), 0, 0 } }, { { TU("?\035"), 2, 3 } } }, + /* 7*/ { 0, 1, 0, { { TU("1A\\^1"), 0, 0 } }, { { TU("1A\035"), 3, 3 } } }, + /* 8*/ { 0, 1, 0, { { TU("\\^1\\^^1A\\^1"), 0, 0 } }, { { TU("\\^1A\035"), 5, 3 } } }, + /* 9*/ { 0, 1, 5, { { TU("\\^1\\^^1A\\^1"), 0, 0 } }, { { TU("\035\\^1A\035"), 6, 5 } } }, + /* 10*/ { 1, 2, 27, { { TU("\\^^A"), 0, 0 }, { TU("\\^1A\\^^1\\^1B\\^"), 0, 0 } }, { { TU("\\^^A"), 0, 0 }, { TU("\035A\\^1\035B\\^"), 9, 27 } } }, + /* 11*/ { 1, 2, 0, { { TU("\\^^A"), 0, 0 }, { TU("\\^1A\\^^1\\^1B\\^"), 0, 0 } }, { { TU("\\^^A"), 0, 0 }, { TU("\035A\\^1\035B\\^"), 9, 3 } } }, + }; + const int data_size = ARRAY_SIZE(data); + int i, ret; + + struct zint_symbol s_symbol = {0}; + struct zint_symbol *symbol = &s_symbol; + + char escaped[4096]; + char escaped2[4096]; + + testStart(p_ctx->func_name); + + symbol->debug = debug; + + for (i = 0; i < data_size; i++) { + int expected_length; + unsigned char *expected_source; + int expected_eci = data[i].eci ? data[i].eci : 3; + int seg_idx = data[i].seg_idx; + + if (testContinue(p_ctx, i)) continue; + + ret = z_ct_cpy_segs(symbol, data[i].segs, data[i].seg_count); + assert_zero(ret, "i:%d z_ct_cpy_segs %d != 0\n", i, ret); + assert_nonnull(symbol->content_segs, "i:%d content_segs NULL\n", i); + + z_ct_set_seg_extra_escapes_eci(symbol, seg_idx, data[i].eci); + assert_nonnull(symbol->content_segs[seg_idx].source, "i:%d content_segs[%d].source NULL\n", i, seg_idx); + + expected_length = data[i].expected_content_segs[seg_idx].length; + expected_source = data[i].expected_content_segs[seg_idx].source; + + assert_equal(symbol->content_segs[seg_idx].length, expected_length, + "i:%d content_segs[%d].length %d != expected_length %d\n", + i, seg_idx, symbol->content_segs[seg_idx].length, expected_length); + assert_zero(memcmp(symbol->content_segs[seg_idx].source, expected_source, expected_length), + "i:%d content_segs[%d].source memcmp(%s, %s, %d) != 0\n", i, seg_idx, + testUtilEscape(ZCCP(symbol->content_segs[seg_idx].source), symbol->content_segs[seg_idx].length, + escaped, sizeof(escaped)), + testUtilEscape(ZCCP(expected_source), expected_length, escaped2, sizeof(escaped2)), + expected_length); + assert_equal(symbol->content_segs[seg_idx].eci, expected_eci, "i:%d content_segs[%d].eci %d != expected_eci %d\n", + i, seg_idx, symbol->content_segs[seg_idx].eci, expected_eci); + + ZBarcode_Clear(symbol); + } + + testFinish(); +} + static void test_ct_cpy_iso8859_1(const testCtx *const p_ctx) { int debug = p_ctx->debug; @@ -1287,7 +1425,7 @@ static void test_ct_cpy_iso8859_1(const testCtx *const p_ctx) { i, symbol->content_segs[0].length, expected_length); assert_zero(memcmp(symbol->content_segs[0].source, data[i].expected, expected_length), "i:%d content_segs[0].source memcmp(%s, %s, %d) != 0\n", i, - testUtilEscape((const char *) symbol->content_segs[0].source, symbol->content_segs[0].length, + testUtilEscape(ZCCP(symbol->content_segs[0].source), symbol->content_segs[0].length, escaped, sizeof(escaped)), testUtilEscape(data[i].expected, expected_length, escaped2, sizeof(escaped2)), expected_length); @@ -1355,7 +1493,7 @@ static void test_ct_printf_256(const testCtx *const p_ctx) { i, symbol->content_segs[0].length, expected_length); assert_zero(memcmp(symbol->content_segs[0].source, data[i].expected, expected_length), "i:%d content_segs[0].source memcmp(%s, %s, %d) != 0\n", i, - testUtilEscape((const char *) symbol->content_segs[0].source, symbol->content_segs[0].length, + testUtilEscape(ZCCP(symbol->content_segs[0].source), symbol->content_segs[0].length, escaped, sizeof(escaped)), testUtilEscape(data[i].expected, expected_length, escaped2, sizeof(escaped2)), expected_length); @@ -1489,12 +1627,14 @@ int main(int argc, char *argv[]) { { "test_cnt_digits", test_cnt_digits }, { "test_is_valid_utf8", test_is_valid_utf8 }, { "test_utf8_to_unicode", test_utf8_to_unicode }, + { "test_extra_escapes", test_extra_escapes }, { "test_hrt_cpy_iso8859_1", test_hrt_cpy_iso8859_1 }, { "test_hrt_cpy_nochk", test_hrt_cpy_nochk }, { "test_hrt_cpy_cat_nochk", test_hrt_cpy_cat_nochk }, { "test_hrt_printf_nochk", test_hrt_printf_nochk }, { "test_hrt_conv_gs1_brackets_nochk", test_hrt_conv_gs1_brackets_nochk }, { "test_ct_cpy_segs", test_ct_cpy_segs }, + { "test_ct_set_seg_extra_escapes_eci", test_ct_set_seg_extra_escapes_eci }, { "test_ct_cpy", test_ct_cpy }, { "test_ct_cpy_iso8859_1", test_ct_cpy_iso8859_1 }, { "test_ct_printf_256", test_ct_printf_256 }, diff --git a/backend/tests/test_dmatrix.c b/backend/tests/test_dmatrix.c index 7c5ebdcd..5abe4ae4 100644 --- a/backend/tests/test_dmatrix.c +++ b/backend/tests/test_dmatrix.c @@ -587,6 +587,7 @@ static void test_options(const testCtx *const p_ctx) { struct item { int symbology; int input_mode; + int eci; int option_1; int option_2; int option_3; @@ -604,119 +605,128 @@ static void test_options(const testCtx *const p_ctx) { }; /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ static const struct item data[] = { - /* 0*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "1", 0, 10, 10, "", 1, 1, "" }, - /* 1*/ { BARCODE_DATAMATRIX, -1, 2, -1, -1, -1, { 0, 0, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 524: Older Data Matrix standards are no longer supported", 0, 1, "" }, - /* 2*/ { BARCODE_DATAMATRIX, -1, -1, 1, -1, -1, { 0, 0, "" }, "1", 0, 10, 10, "", 1, 1, "" }, - /* 3*/ { BARCODE_DATAMATRIX, -1, -1, 2, -1, -1, { 0, 0, "" }, "1", 0, 12, 12, "", 2, 1, "" }, - /* 4*/ { BARCODE_DATAMATRIX, -1, -1, 48, -1, -1, { 0, 0, "" }, "1", 0, 26, 64, "", 48, 1, "" }, - /* 5*/ { BARCODE_DATAMATRIX, -1, -1, 49, -1, -1, { 0, 0, "" }, "1", 0, 10, 10, "", 1, 0, "Ignored; BWIPP no options set" }, - /* 6*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "____", 0, 12, 12, "", 2, 1, "4 data" }, - /* 7*/ { BARCODE_DATAMATRIX, -1, -1, 1, -1, -1, { 0, 0, "" }, "____", ZINT_ERROR_TOO_LONG, -1, -1, "Error 522: Input too long for Version 1, requires 4 codewords (maximum 3)", 1, 1, "" }, - /* 8*/ { BARCODE_DATAMATRIX, -1, -1, 25, -1, -1, { 0, 0, "" }, "____", 0, 8, 18, "", 25, 1, "" }, - /* 9*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "10 data" }, - /* 10*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "" }, - /* 11*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE | DM_ISO_144, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "" }, - /* 12*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE | DM_ISO_144 | DM_B256_START, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "" }, - /* 13*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE | DM_ISO_144 | DM_C40_START, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "" }, - /* 14*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "__________", 0, 16, 16, "", 4, 1, "" }, - /* 15*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE | DM_ISO_144 | DM_B256_START, -1, { 0, 0, "" }, "__________", 0, 16, 16, "", 4, 1, "" }, - /* 16*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE | DM_ISO_144 | DM_C40_START, -1, { 0, 0, "" }, "__________", 0, 16, 16, "", 4, 1, "" }, - /* 17*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________", 0, 12, 26, "", 27, 1, "15 data" }, - /* 18*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________", 0, 12, 26, "", 27, 1, "" }, - /* 19*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________", 0, 18, 18, "", 5, 1, "" }, - /* 20*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE | DM_SQUARE, -1, { 0, 0, "" }, "_______________", 0, 12, 26, "", 27, 1, "DM_DMRE trumps DM_SQUARE" }, - /* 21*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "__________________", 0, 18, 18, "", 5, 1, "18 data" }, - /* 22*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "___________________", 0, 20, 20, "", 6, 1, "19 data" }, - /* 23*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_____________________", 0, 20, 20, "", 6, 1, "21 data" }, - /* 24*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________", 0, 22, 22, "", 7, 1, "23 data" }, - /* 25*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________", 0, 8, 64, "", 32, 1, "" }, - /* 26*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________", 0, 22, 22, "", 7, 1, "" }, - /* 27*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________________", 0, 16, 36, "", 29, 1, "31 data" }, - /* 28*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________________", 0, 16, 36, "", 29, 0, "BWIPP DMRE requires dimensions" }, - /* 29*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________________", 0, 24, 24, "", 8, 1, "" }, - /* 30*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_____________________________________", 0, 26, 26, "", 9, 1, "37 data" }, - /* 31*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_____________________________________", 0, 8, 96, "", 34, 1, "" }, - /* 32*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_____________________________________", 0, 26, 26, "", 9, 1, "" }, - /* 33*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________________________", 0, 26, 26, "", 9, 1, "39 data" }, - /* 34*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________________________", 0, 12, 64, "", 37, 1, "" }, - /* 35*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________________________", 0, 26, 26, "", 9, 1, "" }, - /* 36*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "___________________________________________", 0, 26, 26, "", 9, 1, "43 data" }, - /* 37*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "___________________________________________", 0, 12, 64, "", 37, 1, "" }, - /* 38*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "___________________________________________", 0, 26, 26, "", 9, 1, "" }, - /* 39*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "____________________________________________", 0, 26, 26, "", 9, 1, "44 data" }, - /* 40*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_____________________________________________", 0, 16, 48, "", 30, 1, "45 data" }, - /* 41*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_____________________________________________", 0, 16, 48, "", 30, 0, "BWIPP DMRE requires dimensions" }, - /* 42*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_____________________________________________", 0, 32, 32, "", 10, 1, "" }, - /* 43*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_________________________________________________", 0, 16, 48, "", 30, 1, "49 data" }, - /* 44*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_________________________________________________", 0, 16, 48, "", 30, 0, "BWIPP DMRE requires dimensions" }, - /* 45*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_________________________________________________", 0, 32, 32, "", 10, 1, "" }, - /* 46*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "__________________________________________________", 0, 32, 32, "", 10, 1, "50 data" }, - /* 47*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "__________________________________________________", 0, 20, 44, "", 41, 1, "" }, - /* 48*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "__________________________________________________", 0, 32, 32, "", 10, 1, "" }, - /* 49*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTU", 0, 32, 32, "", 10, 0, "51 data; BWIPP different encodation" }, - /* 50*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTU", 0, 20, 44, "", 41, 0, "BWIPP DMRE requires dimensions" }, - /* 51*/ { BARCODE_DATAMATRIX, -1, -1, -1, 9999, -1, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTU", 0, 32, 32, "", 10, 0, "Ignored; BWIPP different encodation" }, - /* 52*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_____________________________________________________________", 0, 32, 32, "", 10, 1, "61 data" }, - /* 53*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "______________________________________________________________", 0, 32, 32, "", 10, 1, "62 data" }, - /* 54*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________________________________________________", 0, 36, 36, "", 11, 1, "63 data" }, - /* 55*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________________________________________________", 0, 8, 144, "", 36, 1, "" }, - /* 56*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________________________________________________", 0, 36, 36, "", 11, 1, "" }, - /* 57*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "________________________________________________________________", 0, 36, 36, "", 11, 1, "64 data" }, - /* 58*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "________________________________________________________________", 0, 12, 88, "", 38, 1, "" }, - /* 59*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, - /* 60*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_________________________________________________________________", 0, 36, 36, "", 11, 1, "65 data" }, - /* 61*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_________________________________________________________________", 0, 26, 40, "", 46, 1, "" }, - /* 62*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, - /* 63*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "______________________________________________________________________", 0, 36, 36, "", 11, 1, "70 data" }, - /* 64*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "______________________________________________________________________", 0, 26, 40, "", 46, 1, "" }, - /* 65*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "______________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, - /* 66*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________________________________________________________", 0, 36, 36, "", 11, 1, "71 data" }, - /* 67*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________________________________________________________", 0, 22, 48, "", 43, 1, "" }, - /* 68*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, - /* 69*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "________________________________________________________________________________", 0, 36, 36, "", 11, 1, "80 data" }, - /* 70*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "________________________________________________________________________________", 0, 24, 48, "", 44, 1, "" }, - /* 71*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "________________________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, - /* 72*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "____________________________________________________________________________________", 0, 36, 36, "", 11, 1, "84 data" }, - /* 73*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "____________________________________________________________________________________", 0, 20, 64, "", 42, 1, "" }, - /* 74*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "____________________________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, - /* 75*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "__________________________________________________________________________________________", 0, 40, 40, "", 12, 1, "90 data" }, - /* 76*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "__________________________________________________________________________________________", 0, 26, 48, "", 47, 1, "" }, - /* 77*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "__________________________________________________________________________________________", 0, 40, 40, "", 12, 1, "" }, - /* 78*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "___________________________________________________________________________________________", 0, 40, 40, "", 12, 1, "91 data" }, - /* 79*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "___________________________________________________________________________________________", 0, 24, 64, "", 45, 1, "" }, - /* 80*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "___________________________________________________________________________________________", 0, 40, 40, "", 12, 1, "" }, - /* 81*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 0, "" }, "______________________________________________________________________________________________________________________", 0, 44, 44, "", 13, 1, "118 data" }, - /* 82*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "______________________________________________________________________________________________________________________", 0, 26, 64, "", 48, 1, "118 data" }, - /* 83*/ { BARCODE_DATAMATRIX, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "______________________________________________________________________________________________________________________", 0, 44, 44, "", 13, 1, "118 data" }, - /* 84*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, -1, -1, { 0, 0, "" }, "[90]12", 0, 10, 10, "", 1, 1, "" }, - /* 85*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, -1, -1, -1, { 0, 0, "" }, "(90)12", 0, 10, 10, "", 1, 1, "" }, - /* 86*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, -1, -1, { 0, 0, "" }, "[90](", 0, 10, 10, "", 1, 1, "" }, - /* 87*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, -1, -1, -1, { 0, 0, "" }, "(90)(", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 253: Malformed AI in input (brackets don't match)", 0, 1, "" }, - /* 88*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, -1, -1, -1, { 0, 0, "" }, "(90)\\(", 0, 10, 10, "", 1, 1, "" }, /* Escaped parens now work without ESCAPE_MODE */ - /* 89*/ { BARCODE_DATAMATRIX, GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, -1, -1, -1, { 0, 0, "" }, "(90)\\(", 0, 10, 10, "", 1, 1, "" }, - /* 90*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 1, 2, "" }, "1", 0, 12, 12, "", 2, 1, "" }, - /* 91*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 16, 16, "" }, "1", 0, 12, 12, "", 2, 1, "" }, - /* 92*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 1, 1, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 720: Structured Append count '1' out of range (2 to 16)", 0, 1, "" }, - /* 93*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 1, 17, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 720: Structured Append count '17' out of range (2 to 16)", 0, 1, "" }, - /* 94*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 0, 16, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 721: Structured Append index '0' out of range (1 to count 16)", 0, 1, "" }, - /* 95*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 17, 16, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 721: Structured Append index '17' out of range (1 to count 16)", 0, 1, "" }, - /* 96*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 2, 3, "1001" }, "1", 0, 12, 12, "", 2, 1, "" }, - /* 97*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 2, 3, "A" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 723: Invalid Structured Append ID (digits only)", 0, 1, "" }, - /* 98*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 2, 3, "0" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 724: Structured Append ID1 '000' and ID2 '000' out of range (001 to 254) (ID \"000000\")", 0, 1, "" }, - /* 99*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 2, 3, "1" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 725: Structured Append ID1 '000' out of range (001 to 254) (ID \"000001\")", 0, 1, "" }, - /*100*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 2, 3, "1000" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 726: Structured Append ID2 '000' out of range (001 to 254) (ID \"001000\")", 0, 1, "" }, - /*101*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 2, 3, "001255" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 726: Structured Append ID2 '255' out of range (001 to 254) (ID \"001255\")", 0, 1, "" }, - /*102*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 2, 3, "255001" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 725: Structured Append ID1 '255' out of range (001 to 254) (ID \"255001\")", 0, 1, "" }, - /*103*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 2, 3, "255255" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 724: Structured Append ID1 '255' and ID2 '255' out of range (001 to 254) (ID \"255255\")", 0, 1, "" }, - /*104*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, { 2, 3, "1234567" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 722: Structured Append ID length 7 too long (6 digit maximum)", 0, 1, "" }, - /*105*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, READER_INIT, { 2, 3, "1001" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 727: Cannot have Structured Append and Reader Initialisation at the same time", 0, 1, "" }, - /*106*/ { BARCODE_DATAMATRIX, ESCAPE_MODE, -1, -1, -1, -1, { 2, 3, "1001" }, "[)>\\R05\\GA\\R\\E", 0, 12, 26, "", 27, 1, "Macro05/06 ignored if have Structured Append TODO: error/warning " }, - /*107*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, { 0, 0, "" }, "1234,67", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 203: Invalid character at position 5 in input (alphanumerics, space and \"-.$/+%\" only)", 0, 1, "" }, - /*108*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 12, 26, "", 27, 1, "" }, - /*109*/ { BARCODE_HIBC_DM, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 12, 26, "", 27, 1, "" }, - /*110*/ { BARCODE_HIBC_DM, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 18, 18, "", 5, 1, "" }, - /*111*/ { BARCODE_HIBC_DM, -1, 0, -1, DM_B256_START, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 20, 20, "", 6, 0, "BWIPP: same as above" }, - /*112*/ { BARCODE_HIBC_DM, -1, 0, -1, DM_C40_START, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 12, 26, "", 27, 1, "" }, + /* 0*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "1", 0, 10, 10, "", 1, 1, "" }, + /* 1*/ { BARCODE_DATAMATRIX, -1, -1, 2, -1, -1, -1, { 0, 0, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 524: Older Data Matrix standards are no longer supported", 0, 1, "" }, + /* 2*/ { BARCODE_DATAMATRIX, -1, -1, -1, 1, -1, -1, { 0, 0, "" }, "1", 0, 10, 10, "", 1, 1, "" }, + /* 3*/ { BARCODE_DATAMATRIX, -1, -1, -1, 2, -1, -1, { 0, 0, "" }, "1", 0, 12, 12, "", 2, 1, "" }, + /* 4*/ { BARCODE_DATAMATRIX, -1, -1, -1, 48, -1, -1, { 0, 0, "" }, "1", 0, 26, 64, "", 48, 1, "" }, + /* 5*/ { BARCODE_DATAMATRIX, -1, -1, -1, 49, -1, -1, { 0, 0, "" }, "1", 0, 10, 10, "", 1, 0, "Ignored; BWIPP no options set" }, + /* 6*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "____", 0, 12, 12, "", 2, 1, "4 data" }, + /* 7*/ { BARCODE_DATAMATRIX, -1, -1, -1, 1, -1, -1, { 0, 0, "" }, "____", ZINT_ERROR_TOO_LONG, -1, -1, "Error 522: Input too long for Version 1, requires 4 codewords (maximum 3)", 1, 1, "" }, + /* 8*/ { BARCODE_DATAMATRIX, -1, -1, -1, 25, -1, -1, { 0, 0, "" }, "____", 0, 8, 18, "", 25, 1, "" }, + /* 9*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "10 data" }, + /* 10*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "" }, + /* 11*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE | DM_ISO_144, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "" }, + /* 12*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE | DM_ISO_144 | DM_B256_START, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "" }, + /* 13*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE | DM_ISO_144 | DM_C40_START, -1, { 0, 0, "" }, "__________", 0, 8, 32, "", 26, 1, "" }, + /* 14*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "__________", 0, 16, 16, "", 4, 1, "" }, + /* 15*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE | DM_ISO_144 | DM_B256_START, -1, { 0, 0, "" }, "__________", 0, 16, 16, "", 4, 1, "" }, + /* 16*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE | DM_ISO_144 | DM_C40_START, -1, { 0, 0, "" }, "__________", 0, 16, 16, "", 4, 1, "" }, + /* 17*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________", 0, 12, 26, "", 27, 1, "15 data" }, + /* 18*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________", 0, 12, 26, "", 27, 1, "" }, + /* 19*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________", 0, 18, 18, "", 5, 1, "" }, + /* 20*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE | DM_SQUARE, -1, { 0, 0, "" }, "_______________", 0, 12, 26, "", 27, 1, "DM_DMRE trumps DM_SQUARE" }, + /* 21*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "__________________", 0, 18, 18, "", 5, 1, "18 data" }, + /* 22*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "___________________", 0, 20, 20, "", 6, 1, "19 data" }, + /* 23*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_____________________", 0, 20, 20, "", 6, 1, "21 data" }, + /* 24*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________", 0, 22, 22, "", 7, 1, "23 data" }, + /* 25*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________", 0, 8, 64, "", 32, 1, "" }, + /* 26*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________", 0, 22, 22, "", 7, 1, "" }, + /* 27*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________________", 0, 16, 36, "", 29, 1, "31 data" }, + /* 28*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________________", 0, 16, 36, "", 29, 0, "BWIPP DMRE requires dimensions" }, + /* 29*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________________", 0, 24, 24, "", 8, 1, "" }, + /* 30*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_____________________________________", 0, 26, 26, "", 9, 1, "37 data" }, + /* 31*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_____________________________________", 0, 8, 96, "", 34, 1, "" }, + /* 32*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_____________________________________", 0, 26, 26, "", 9, 1, "" }, + /* 33*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________________________", 0, 26, 26, "", 9, 1, "39 data" }, + /* 34*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________________________", 0, 12, 64, "", 37, 1, "" }, + /* 35*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________________________", 0, 26, 26, "", 9, 1, "" }, + /* 36*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "___________________________________________", 0, 26, 26, "", 9, 1, "43 data" }, + /* 37*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "___________________________________________", 0, 12, 64, "", 37, 1, "" }, + /* 38*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "___________________________________________", 0, 26, 26, "", 9, 1, "" }, + /* 39*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "____________________________________________", 0, 26, 26, "", 9, 1, "44 data" }, + /* 40*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_____________________________________________", 0, 16, 48, "", 30, 1, "45 data" }, + /* 41*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_____________________________________________", 0, 16, 48, "", 30, 0, "BWIPP DMRE requires dimensions" }, + /* 42*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_____________________________________________", 0, 32, 32, "", 10, 1, "" }, + /* 43*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_________________________________________________", 0, 16, 48, "", 30, 1, "49 data" }, + /* 44*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_________________________________________________", 0, 16, 48, "", 30, 0, "BWIPP DMRE requires dimensions" }, + /* 45*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_________________________________________________", 0, 32, 32, "", 10, 1, "" }, + /* 46*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "__________________________________________________", 0, 32, 32, "", 10, 1, "50 data" }, + /* 47*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "__________________________________________________", 0, 20, 44, "", 41, 1, "" }, + /* 48*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "__________________________________________________", 0, 32, 32, "", 10, 1, "" }, + /* 49*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTU", 0, 32, 32, "", 10, 0, "51 data; BWIPP different encodation" }, + /* 50*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTU", 0, 20, 44, "", 41, 0, "BWIPP DMRE requires dimensions" }, + /* 51*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, 9999, -1, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTU", 0, 32, 32, "", 10, 0, "Ignored; BWIPP different encodation" }, + /* 52*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_____________________________________________________________", 0, 32, 32, "", 10, 1, "61 data" }, + /* 53*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "______________________________________________________________", 0, 32, 32, "", 10, 1, "62 data" }, + /* 54*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________________________________________________", 0, 36, 36, "", 11, 1, "63 data" }, + /* 55*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________________________________________________", 0, 8, 144, "", 36, 1, "" }, + /* 56*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________________________________________________", 0, 36, 36, "", 11, 1, "" }, + /* 57*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "________________________________________________________________", 0, 36, 36, "", 11, 1, "64 data" }, + /* 58*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "________________________________________________________________", 0, 12, 88, "", 38, 1, "" }, + /* 59*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, + /* 60*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_________________________________________________________________", 0, 36, 36, "", 11, 1, "65 data" }, + /* 61*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_________________________________________________________________", 0, 26, 40, "", 46, 1, "" }, + /* 62*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, + /* 63*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "______________________________________________________________________", 0, 36, 36, "", 11, 1, "70 data" }, + /* 64*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "______________________________________________________________________", 0, 26, 40, "", 46, 1, "" }, + /* 65*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "______________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, + /* 66*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "_______________________________________________________________________", 0, 36, 36, "", 11, 1, "71 data" }, + /* 67*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "_______________________________________________________________________", 0, 22, 48, "", 43, 1, "" }, + /* 68*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "_______________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, + /* 69*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "________________________________________________________________________________", 0, 36, 36, "", 11, 1, "80 data" }, + /* 70*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "________________________________________________________________________________", 0, 24, 48, "", 44, 1, "" }, + /* 71*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "________________________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, + /* 72*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "____________________________________________________________________________________", 0, 36, 36, "", 11, 1, "84 data" }, + /* 73*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "____________________________________________________________________________________", 0, 20, 64, "", 42, 1, "" }, + /* 74*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "____________________________________________________________________________________", 0, 36, 36, "", 11, 1, "" }, + /* 75*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "__________________________________________________________________________________________", 0, 40, 40, "", 12, 1, "90 data" }, + /* 76*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "__________________________________________________________________________________________", 0, 26, 48, "", 47, 1, "" }, + /* 77*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "__________________________________________________________________________________________", 0, 40, 40, "", 12, 1, "" }, + /* 78*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "___________________________________________________________________________________________", 0, 40, 40, "", 12, 1, "91 data" }, + /* 79*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "___________________________________________________________________________________________", 0, 24, 64, "", 45, 1, "" }, + /* 80*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "___________________________________________________________________________________________", 0, 40, 40, "", 12, 1, "" }, + /* 81*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "______________________________________________________________________________________________________________________", 0, 44, 44, "", 13, 1, "118 data" }, + /* 82*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "______________________________________________________________________________________________________________________", 0, 26, 64, "", 48, 1, "118 data" }, + /* 83*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "______________________________________________________________________________________________________________________", 0, 44, 44, "", 13, 1, "118 data" }, + /* 84*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "[90]12", 0, 10, 10, "", 1, 1, "" }, + /* 85*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "(90)12", 0, 10, 10, "", 1, 1, "" }, + /* 86*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "[90](", 0, 10, 10, "", 1, 1, "" }, + /* 87*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "(90)(", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 253: Malformed AI in input (brackets don't match)", 0, 1, "" }, + /* 88*/ { BARCODE_DATAMATRIX, GS1_MODE | GS1PARENS_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "(90)\\(", 0, 10, 10, "", 1, 1, "" }, /* Escaped parens now work without ESCAPE_MODE */ + /* 89*/ { BARCODE_DATAMATRIX, GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "(90)\\(", 0, 10, 10, "", 1, 1, "" }, + /* 90*/ { BARCODE_DATAMATRIX, EXTRA_ESCAPE_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "A", 0, 10, 10, "", 1, 1, "" }, + /* 91*/ { BARCODE_DATAMATRIX, EXTRA_ESCAPE_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "\\^1\\^^1\\^1", 0, 12, 12, "", 2, 1, "" }, + /* 92*/ { BARCODE_DATAMATRIX, EXTRA_ESCAPE_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "\\^1\\^^\\^", 0, 12, 12, "", 2, 1, "" }, + /* 93*/ { BARCODE_DATAMATRIX, EXTRA_ESCAPE_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "\\^1\\^^\\^2", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 717: Unrecognized extra escape \"\\^2\"", 0, 1, "" }, + /* 94*/ { BARCODE_DATAMATRIX, GS1_MODE | EXTRA_ESCAPE_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "[90]12", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 844: Cannot use extra escape mode in GS1 mode", 0, 1, "" }, + /* 95*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 9, -1, -1, -1, -1, { 0, 0, "" }, "α\\^1ÎČ", 0, 14, 14, "", 3, 1, "ECI ISO/IEC 8859-7 Greek" }, + /* 96*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 20, -1, -1, -1, -1, { 0, 0, "" }, "あ\\^1ば", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 716: Extra escape mode requires ASCII-compatible ECI", 0, 1, "ECI Shift JIS" }, + /* 97*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 899, -1, -1, -1, -1, { 0, 0, "" }, "A\\^1B", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 716: Extra escape mode requires ASCII-compatible ECI", 0, 1, "ECI 8-bit binary" }, + /* 98*/ { BARCODE_HIBC_DM, EXTRA_ESCAPE_MODE, -1, -1, -1, -1, -1, { 0, 0, "" }, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 843: Can only use extra escape mode with non-variant Data Matrix", 0, 1, "" }, + /* 99*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 1, 2, "" }, "1", 0, 12, 12, "", 2, 1, "" }, + /*100*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 16, 16, "" }, "1", 0, 12, 12, "", 2, 1, "" }, + /*101*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 1, 1, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 720: Structured Append count '1' out of range (2 to 16)", 0, 1, "" }, + /*102*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 1, 17, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 720: Structured Append count '17' out of range (2 to 16)", 0, 1, "" }, + /*103*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 0, 16, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 721: Structured Append index '0' out of range (1 to count 16)", 0, 1, "" }, + /*104*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 17, 16, "" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 721: Structured Append index '17' out of range (1 to count 16)", 0, 1, "" }, + /*105*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 2, 3, "1001" }, "1", 0, 12, 12, "", 2, 1, "" }, + /*106*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 2, 3, "A" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 723: Invalid Structured Append ID (digits only)", 0, 1, "" }, + /*107*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 2, 3, "0" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 724: Structured Append ID1 '000' and ID2 '000' out of range (001 to 254) (ID \"000000\")", 0, 1, "" }, + /*108*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 2, 3, "1" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 725: Structured Append ID1 '000' out of range (001 to 254) (ID \"000001\")", 0, 1, "" }, + /*109*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 2, 3, "1000" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 726: Structured Append ID2 '000' out of range (001 to 254) (ID \"001000\")", 0, 1, "" }, + /*110*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 2, 3, "001255" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 726: Structured Append ID2 '255' out of range (001 to 254) (ID \"001255\")", 0, 1, "" }, + /*111*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 2, 3, "255001" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 725: Structured Append ID1 '255' out of range (001 to 254) (ID \"255001\")", 0, 1, "" }, + /*112*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 2, 3, "255255" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 724: Structured Append ID1 '255' and ID2 '255' out of range (001 to 254) (ID \"255255\")", 0, 1, "" }, + /*113*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, -1, { 2, 3, "1234567" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 722: Structured Append ID length 7 too long (6 digit maximum)", 0, 1, "" }, + /*114*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, READER_INIT, { 2, 3, "1001" }, "1", ZINT_ERROR_INVALID_OPTION, -1, -1, "Error 727: Cannot have Structured Append and Reader Initialisation at the same time", 0, 1, "" }, + /*115*/ { BARCODE_DATAMATRIX, ESCAPE_MODE, -1, -1, -1, -1, -1, { 2, 3, "1001" }, "[)>\\R05\\GA\\R\\E", 0, 12, 26, "", 27, 1, "Macro05/06 ignored if have Structured Append TODO: error/warning " }, + /*116*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "1234,67", ZINT_ERROR_INVALID_DATA, -1, -1, "Error 203: Invalid character at position 5 in input (alphanumerics, space and \"-.$/+%\" only)", 0, 1, "" }, + /*117*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 12, 26, "", 27, 1, "" }, + /*118*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, DM_DMRE, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 12, 26, "", 27, 1, "" }, + /*119*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, DM_SQUARE, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 18, 18, "", 5, 1, "" }, + /*120*/ { BARCODE_HIBC_DM, -1, -1, 0, -1, DM_B256_START, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 20, 20, "", 6, 0, "BWIPP: same as above" }, + /*121*/ { BARCODE_HIBC_DM, -1, -1, 0, -1, DM_C40_START, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 12, 26, "", 27, 1, "" }, }; const int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -740,7 +750,7 @@ static void test_options(const testCtx *const p_ctx) { assert_nonnull(symbol, "Symbol not created\n"); debug &= ~ZINT_DEBUG_TEST; /* Want real errtxt */ - length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, + length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, data[i].eci, data[i].option_1, data[i].option_2, data[i].option_3, data[i].output_options, data[i].data, -1, debug); if (data[i].structapp.count) { @@ -765,10 +775,11 @@ static void test_options(const testCtx *const p_ctx) { } } else { char modules_dump[144 * 144 + 1]; + int parsefnc = (data[i].input_mode & EXTRA_ESCAPE_MODE) && strchr(data[i].data, '^') != NULL; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, data[i].option_3, data[i].data, - length, NULL, cmp_buf, sizeof(cmp_buf), NULL); + length, NULL, cmp_buf, sizeof(cmp_buf), &parsefnc); assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); @@ -782,8 +793,8 @@ static void test_options(const testCtx *const p_ctx) { char modules_dump[144 * 144 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, 1 /*zxingcpp_cmp*/, cmp_buf, - sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, + data[i].eci > 0 ? data[i].eci : 1 /*zxingcpp_cmp*/, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); @@ -846,6 +857,7 @@ static void test_reader_init(const testCtx *const p_ctx) { const char *expected; const char *comment; }; + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ static const struct item data[] = { /* 0*/ { BARCODE_DATAMATRIX, UNICODE_MODE, READER_INIT, "A", 0, 10, 10, "EA 42 81 19 A4 53 21 DF", "" }, /* 1*/ { BARCODE_DATAMATRIX, GS1_MODE, READER_INIT, "[91]A", ZINT_ERROR_INVALID_OPTION, 0, 0, "Error 521: Cannot use Reader Initialisation in GS1 mode", "" }, @@ -933,10 +945,12 @@ static void test_reader_init(const testCtx *const p_ctx) { testFinish(); } +#if 1 #define ZINT_TEST_ENCODING +#endif #ifdef ZINT_TEST_ENCODING -INTERNAL int zint_test_dm_encode(struct zint_symbol *symbol, const unsigned char source[], const int length, - const int eci, const int last_seg, const int gs1, const int b256_end, const int c40_end, +INTERNAL int zint_test_dm_encode(struct zint_symbol *symbol, const unsigned char source[], int length, + const int eci, const int last_seg, const char *fncs, const int b256_end, const int c40_end, unsigned char target[], int *p_tp); #endif @@ -964,6 +978,7 @@ static void test_input(const testCtx *const p_ctx) { int expected_diff; /* Difference between default minimal encodation and ISO encodation (FAST_MODE) */ }; + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ static const struct item data[] = { /* 0*/ { UNICODE_MODE | FAST_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "0466010592130100000k*AGUATY80", 0, 0, 18, 18, 1, 1, "(32) 86 C4 83 87 DE 8F 83 82 82 31 6C EE 08 85 D6 D2 EF 65 93 B0 1C 3C 76 FB D4 AB 16 11", "#208", 0 }, /* 1*/ { UNICODE_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "0466010592130100000k*AGUATY80", 0, 0, 18, 18, 1, 1, "(32) 86 C4 83 87 DE 8F 83 82 82 31 6C EE 08 85 D6 D2 EF 65 93 B0 1C 3C 76 FB D4 AB 16 11", "#208", 0 }, @@ -1249,6 +1264,15 @@ static void test_input(const testCtx *const p_ctx) { /*281*/ { UNICODE_MODE | FAST_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "A*B>C 1A*B>C 1*\013B>C 1A*B>C 1A*", 0, 0, 22, 22, 1, 1, "(50) EE 57 B8 0F 04 21 72 5E 21 13 8A FE 0C EE 5E 21 13 97 08 9B 64 7E FE 42 2B 81 68 FE", "process_p 0", 1 }, /*282*/ { GS1_MODE, 0, -1, -1, -1, -1, { 1, 2, "" }, "[20]01", 0, 0, 14, 14, 1, 1, "E9 0F 01 01 E8 96 83 81 DE 06 E8 61 E2 B5 19 CE A3 F8", "", 0 }, /*283*/ { GS1_MODE, 3, -1, -1, -1, -1, { 1, 2, "123234" }, "[20]01", 0, 3, 8, 32, 1, 1, "E9 0F 7B EA E8 F1 04 96 83 81 47 4D F5 6F E8 62 DA 1C 06 7F 03", "", 0 }, + /*284*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "A\\^1B", 0, 0, 10, 10, 1, 1, "42 E8 43 E5 E2 F8 F5 E5", "", 1 }, + /*285*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "a\\^1B", 0, 0, 10, 10, 1, 1, "62 E8 43 52 07 83 91 CF", "", 1 }, + /*286*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "9\\^1A", 0, 0, 10, 10, 1, 1, "3A E8 42 12 19 12 42 F6", "", 1 }, + /*287*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "99\\^1A", 0, 0, 10, 10, 1, 1, "E5 E8 42 B0 7D B7 7B 6F", "", 1 }, + /*288*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "?\\^1A", 0, 0, 10, 10, 1, 1, "40 E8 42 E7 07 1A 88 26", "", 1 }, + /*289*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, 0, -1, -1, -1, -1, { 1, 2, "" }, "A\\^1B", 0, 0, 14, 14, 1, 1, "E9 0F 01 01 42 E8 43 81 F4 7B DC 13 EA 49 14 75 EA 25", "", 1 }, + /*290*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "\\^1\\^1\\^1", 0, 0, 10, 10, 1, 1, "E8 E8 E8 88 6E 8B A4 5E", "", 1 }, + /*291*/ { UNICODE_MODE | FAST_MODE | EXTRA_ESCAPE_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "ABCDEF\\^1GHIJK\\^1LM\\^1", 0, 0, 12, 26, 1, 1, "E6 59 E9 6D 24 0A 8D 86 C8 96 44 FE 4D 4E E8 81 33 8F 19 0F D7 59 96 B4 D8 43 49 D7 F3 B6", "BWIPP: different encodation", 0 }, + /*292*/ { UNICODE_MODE | EXTRA_ESCAPE_MODE, 0, -1, -1, -1, -1, { 0, 0, "" }, "ABCDEF\\^1GHIJK\\^1LM\\^1", 0, 0, 12, 26, 0, 1, "E6 59 E9 6D 24 0A 8D 86 C8 FE 4C E8 4D 4E E8 81 49 98 C6 DD DA A6 89 B1 83 08 56 71 C1 51", "BWIPP: same as FAST_MODE", 0 }, }; const int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -1342,8 +1366,8 @@ static void test_input(const testCtx *const p_ctx) { ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); assert_zero(ret, "i:%d %s testUtilZXingCPPCmp %d != 0 %s\n actual: %.*s\nexpected: %.*s\n", - i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_len, cmp_buf, ret_len, - escaped); + i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_len, cmp_buf, + ret_len, escaped); } } @@ -1356,6 +1380,7 @@ static void test_input(const testCtx *const p_ctx) { && data[i].output_options == data[i - 1].output_options && strcmp(data[i].data, data[i - 1].data) == 0) { unsigned char binary[2][2200] ZINT_TESTUTIL_SANITIZEM_INIT_2D; + char *fncs = (char *) z_alloca(length); int gs1; int binlen; int binlens[2] = {0}; @@ -1381,7 +1406,8 @@ static void test_input(const testCtx *const p_ctx) { symbol->option_2 = data[i].option_2 != -1 ? data[i].option_2 : 0; /* Restore option_2 */ gs1 = (symbol->input_mode & 0x07) != GS1_MODE ? 0 : (symbol->output_options & GS1_GS_SEPARATOR) ? 2 : 1; - ret = zint_test_dm_encode(symbol, text, length, symbol->eci, last_seg, gs1, + memset(fncs, gs1 == 1, length); + ret = zint_test_dm_encode(symbol, text, length, symbol->eci, last_seg, fncs, 0 /*b256_end*/, 0 /*c40_end*/, binary[0], &binlen); assert_zero(ret, "i:%d dm_encode() FAST_MODE ret %d != 0 (%s)\n", i, ret, symbol->errtxt); @@ -1391,8 +1417,9 @@ static void test_input(const testCtx *const p_ctx) { symbol->input_mode = data[i].input_mode; gs1 = (symbol->input_mode & 0x07) != GS1_MODE ? 0 : (symbol->output_options & GS1_GS_SEPARATOR) ? 2 : 1; + memset(fncs, gs1 == 1, length); symbol->option_2 = data[i].option_2 != -1 ? data[i].option_2 : 0; /* Restore option_2 */ - ret = zint_test_dm_encode(symbol, text, length, symbol->eci, last_seg, gs1, + ret = zint_test_dm_encode(symbol, text, length, symbol->eci, last_seg, fncs, 0 /*b256_end*/, 0 /*c40_end*/, binary[1], &binlen); assert_zero(ret, "i:%d dm_encode() minimal ret %d != 0 (%s)\n", i, ret, symbol->errtxt); @@ -1441,6 +1468,7 @@ static void test_encode(const testCtx *const p_ctx) { /* Verified manually against ISO/IEC 16022:2006, ISO/IEC 21471:2020, GS1 General Specifications 21.0.1 (GGS), ANSI/HIBC LIC 2.6-2016 (HIBC/LIC), ANSI/HIBC PAS 1.3-2010 (HIBC/PAS) and AIM ITS/04-023:2022 (ECI Part 3: Register), with noted exceptions */ + /* s/\v(\/\*)[ 0-9]*(\*\/)/\=printf("%s%3d%s", submatch(1), (@z+setreg('z',@z+1)), submatch(2))/ | let @z=0: */ static const struct item data[] = { /* 0*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "1234abcd", -1, 0, 14, 14, 1, 1, "", 0, "10101010101010" @@ -2898,7 +2926,21 @@ static void test_encode(const testCtx *const p_ctx) { "11100101010110100111011000" "11111111111111111111111111" }, - /* 71*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 3, -1, -1, -1, "C:\\DOCS\\EXAMPLE.TXT", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 3 Example 3", 0, + /* 71*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 3, -1, -1, -1, "price:ÂŁ20.00", -1, 0, 12, 26, 1, 1, "AIM ITS/04-023:2022 ECI 3 Example 2", 0, + "10101010101010101010101010" + "10000111010111000110110001" + "10000101101010010011011000" + "11001010011000000101110111" + "10010101000100111011110110" + "11100111000100111100000001" + "11100101111110001101011100" + "10000011101101110011110011" + "11011100101111100110010110" + "10101101100110000001001011" + "11100101010110100111011000" + "11111111111111111111111111" + }, + /* 72*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 3, -1, -1, -1, "C:\\DOCS\\EXAMPLE.TXT", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 3 Example 3", 0, "101010101010101010" "100000001010011011" "100010111000011100" @@ -2918,7 +2960,29 @@ static void test_encode(const testCtx *const p_ctx) { "100110001010000100" "111111111111111111" }, - /* 72*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 4, -1, -1, -1, "Ć tudentska ĆĄt. 2198390", -1, 0, 20, 20, 0, 1, "AIM ITS/04-023:2022 ECI 4 Example 1; BWIPP same as FAST_MODE", 0, + /* 73*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 4, -1, -1, -1, "Ć tudentska ĆĄt. 2198390", -1, 0, 20, 20, 1, 1, "AIM ITS/04-023:2022 ECI 4 Example 1 **NOT SAME** see non-FAST_MODE below", 0, + "10101010101010101010" + "10011100111101101111" + "10001101011111010110" + "11011100101011101001" + "10000100100011000100" + "11110011111010010001" + "11111011001111001000" + "10111001100101100101" + "11101010001101110100" + "10001101000100111011" + "11011111100001011100" + "11001001000110100101" + "11101001001110111000" + "11101110001101101111" + "10001000000110001100" + "11000001000111000101" + "10100010100001101100" + "11100111110101100101" + "11010000011110011010" + "11111111111111111111" + }, + /* 74*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 4, -1, -1, -1, "Ć tudentska ĆĄt. 2198390", -1, 0, 20, 20, 0, 1, "AIM ITS/04-023:2022 ECI 4 Example 1, same; BWIPP same as FAST_MODE", 0, "10101010101010101010" "10001110100110101111" "10001101000001010110" @@ -2940,7 +3004,41 @@ static void test_encode(const testCtx *const p_ctx) { "11010000001001011010" "11111111111111111111" }, - /* 73*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 4, -1, 10, -1, "SzczegóƂowe dane kontaktowe:+48 22 694 60 00", -1, 0, 32, 32, 0, 1, "AIM ITS/04-023:2022 ECI 4 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, + /* 75*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 4, -1, 10, -1, "SzczegóƂowe dane kontaktowe:+48 22 694 60 00", -1, 0, 32, 32, 0, 1, "AIM ITS/04-023:2022 ECI 4 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, + "10101010101010101010101010101010" + "10011100101001011010100101001111" + "10001011100001001100000110000000" + "11011000010101111010000101000101" + "10010001101101101110001011011110" + "11101010000010011100010000100101" + "10010000000111001001011010011110" + "10111111010111111010001100101111" + "11100110110100101110111100110110" + "10100001100100111111110000000001" + "10001010111010101101001011011100" + "11111011101100011011011100011011" + "11111011100000101001011111000000" + "11110010110101011111101100100011" + "10111011100011101110011111110010" + "11111111111111111111111111111111" + "10101010101010101010101010101010" + "11111101100000011011101110111011" + "11101000111100001011100001101110" + "11101011110010011011000100010101" + "11001111000100101000011101110010" + "10110101101110111011011011110101" + "10011001101111001001011100011100" + "11101010111000011111101001111011" + "10011011110011101010010000101100" + "10011101001000111010000000010011" + "11100011010001001110000100110000" + "10011001101000011110111100011101" + "11100101011100001011111110011000" + "10000011100111111010011001010101" + "11001011010011101110001100100000" + "11111111111111111111111111111111" + }, + /* 76*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 4, -1, 10, -1, "SzczegóƂowe dane kontaktowe:+48 22 694 60 00", -1, 0, 32, 32, 0, 1, "AIM ITS/04-023:2022 ECI 4 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, "10101010101010101010101010101010" "10010010111100111011110110001111" "10001111110010101000001000100000" @@ -2974,7 +3072,7 @@ static void test_encode(const testCtx *const p_ctx) { "11001100101101101010010101100000" "11111111111111111111111111111111" }, - /* 74*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 5, -1, -1, DM_SQUARE, "LiÄ„tenƝtejno", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 5 Example 1; BWIPP different encodation", 0, + /* 77*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 5, -1, -1, DM_SQUARE, "LiÄ„tenƝtejno", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 5 Example 1; BWIPP different encodation", 0, "101010101010101010" "100101101010111011" "100011010100011110" @@ -2994,7 +3092,7 @@ static void test_encode(const testCtx *const p_ctx) { "110001011101010110" "111111111111111111" }, - /* 75*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 6, -1, -1, DM_SQUARE, "Lietuvą", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 6 Example 1", 0, + /* 78*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 6, -1, -1, DM_SQUARE, "Lietuvą", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 6 Example 1", 0, "1010101010101010" "1001011011110111" "1000010100001110" @@ -3012,7 +3110,7 @@ static void test_encode(const testCtx *const p_ctx) { "1100100101110010" "1111111111111111" }, - /* 76*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 7, -1, -1, DM_SQUARE, "Đ ĐŸŃŃĐžŃ", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 7 Example 1", 0, + /* 79*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 7, -1, -1, DM_SQUARE, "Đ ĐŸŃŃĐžŃ", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 7 Example 1", 0, "1010101010101010" "1001110110001111" "1001101010110100" @@ -3030,7 +3128,7 @@ static void test_encode(const testCtx *const p_ctx) { "1010110001000010" "1111111111111111" }, - /* 77*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 7, -1, -1, DM_SQUARE, "ĐœĐŸĐœĐłĐŸĐ»ŃƒĐ»Ń", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 7 Example 2", 0, + /* 80*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 7, -1, -1, DM_SQUARE, "ĐœĐŸĐœĐłĐŸĐ»ŃƒĐ»Ń", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 7 Example 2", 0, "101010101010101010" "100111100010010101" "100110000111111110" @@ -3050,7 +3148,7 @@ static void test_encode(const testCtx *const p_ctx) { "110100011110000100" "111111111111111111" }, - /* 78*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 8, -1, -1, DM_SQUARE, "ŰŹÙˆŰ§ŰČ Ű§Ù„ŰłÙŰ±", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 8 Example 1", 0, + /* 81*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 8, -1, -1, DM_SQUARE, "ŰŹÙˆŰ§ŰČ Ű§Ù„ŰłÙŰ±", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 8 Example 1", 0, "101010101010101010" "100111100010000001" "100110001111110010" @@ -3070,7 +3168,7 @@ static void test_encode(const testCtx *const p_ctx) { "101100011100001010" "111111111111111111" }, - /* 79*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 8, -1, -1, -1, "Ű§Ù„Ù…Ù†ŰŽŰŁ: Ű§Ù„Ù…Ù…Ù„ÙƒŰ© Ű§Ù„ŰčŰ±ŰšÙŠŰ© Ű§Ù„ŰłŰčÙˆŰŻÙŠŰ©", -1, 0, 24, 24, 1, 1, "AIM ITS/04-023:2022 ECI 8 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + /* 82*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 8, -1, -1, -1, "Ű§Ù„Ù…Ù†ŰŽŰŁ: Ű§Ù„Ù…Ù…Ù„ÙƒŰ© Ű§Ù„ŰčŰ±ŰšÙŠŰ© Ű§Ù„ŰłŰčÙˆŰŻÙŠŰ©", -1, 0, 24, 24, 1, 1, "AIM ITS/04-023:2022 ECI 8 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, "101010101010101010101010" "100111010010111011001011" "100110111100000010010000" @@ -3096,7 +3194,7 @@ static void test_encode(const testCtx *const p_ctx) { "100111000101101010110010" "111111111111111111111111" }, - /* 80*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 9, -1, -1, DM_SQUARE, "ÎœÎ­ÏÎżÏ‚ #. α123", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 9 Example 1", 0, + /* 83*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 9, -1, -1, DM_SQUARE, "ÎœÎ­ÏÎżÏ‚ #. α123", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 9 Example 1", 0, "101010101010101010" "100111100100000011" "100110001111001100" @@ -3116,7 +3214,7 @@ static void test_encode(const testCtx *const p_ctx) { "111100011110101000" "111111111111111111" }, - /* 81*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 10, -1, -1, -1, "Ś“ŚšŚ›Ś•ŚŸ", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 10 Example 1", 0, + /* 84*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 10, -1, -1, -1, "Ś“ŚšŚ›Ś•ŚŸ", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 10 Example 1", 0, "10101010101010101010101010101010" "10011101110010011001011101110101" "10011110001001001011101011110100" @@ -3126,7 +3224,7 @@ static void test_encode(const testCtx *const p_ctx) { "11010100010001101010000011101010" "11111111111111111111111111111111" }, - /* 82*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 10, -1, -1, -1, "ŚžŚĄŚ€Śš Ś—ŚœŚ§: A20200715001", -1, 0, 20, 20, 0, 1, "AIM ITS/04-023:2022 ECI 10 Example 2 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + /* 85*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 10, -1, -1, -1, "ŚžŚĄŚ€Śš Ś—ŚœŚ§: A20200715001", -1, 0, 20, 20, 0, 1, "AIM ITS/04-023:2022 ECI 10 Example 2 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, "10101010101010101010" "10011110011111000111" "10011101101010101110" @@ -3148,7 +3246,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000111100100101010" "11111111111111111111" }, - /* 83*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 10, -1, -1, -1, "ŚžŚĄŚ€Śš Ś—ŚœŚ§: A20200715001", -1, 0, 20, 20, 1, 1, "AIM ITS/04-023:2022 ECI 10 Example 2 **NOT SAME** different encodation", 0, + /* 86*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 10, -1, -1, -1, "ŚžŚĄŚ€Śš Ś—ŚœŚ§: A20200715001", -1, 0, 20, 20, 1, 1, "AIM ITS/04-023:2022 ECI 10 Example 2 **NOT SAME** different encodation", 0, "10101010101010101010" "10011101100001000111" "10011111111110010110" @@ -3170,7 +3268,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000111010001111010" "11111111111111111111" }, - /* 84*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 11, -1, -1, -1, "Amerika Birleßik Devletleri", -1, 0, 22, 22, 0, 1, "AIM ITS/04-023:2022 ECI 11 Example 1 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + /* 87*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 11, -1, -1, -1, "Amerika Birleßik Devletleri", -1, 0, 22, 22, 0, 1, "AIM ITS/04-023:2022 ECI 11 Example 1 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, "1010101010101010101010" "1000101011001011000001" "1001111101111001101100" @@ -3194,7 +3292,7 @@ static void test_encode(const testCtx *const p_ctx) { "1110010000010000011110" "1111111111111111111111" }, - /* 85*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 11, -1, -1, -1, "Amerika Birleßik Devletleri", -1, 0, 22, 22, 1, 1, "AIM ITS/04-023:2022 ECI 11 Example 1 **NOT SAME** different encodation", 0, + /* 88*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 11, -1, -1, -1, "Amerika Birleßik Devletleri", -1, 0, 22, 22, 1, 1, "AIM ITS/04-023:2022 ECI 11 Example 1 **NOT SAME** different encodation", 0, "1010101010101010101010" "1001110011001011001001" "1001111001111001110100" @@ -3218,7 +3316,7 @@ static void test_encode(const testCtx *const p_ctx) { "1110111101000010011110" "1111111111111111111111" }, - /* 86*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 11, -1, -1, -1, "Biniß kartı #120921039", -1, 0, 20, 20, 0, 1, "AIM ITS/04-023:2022 ECI 11 Example 2; BWIPP different encodation", 0, + /* 89*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 11, -1, -1, -1, "Biniß kartı #120921039", -1, 0, 20, 20, 0, 1, "AIM ITS/04-023:2022 ECI 11 Example 2; BWIPP different encodation", 0, "10101010101010101010" "10001110101011111111" "10010101011000110110" @@ -3240,7 +3338,7 @@ static void test_encode(const testCtx *const p_ctx) { "10000100110101011010" "11111111111111111111" }, - /* 87*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 12, -1, -1, -1, "KĆ«rybiĆĄkumą", -1, 0, 12, 26, 0, 1, "AIM ITS/04-023:2022 ECI 12 Example 1 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + /* 90*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 12, -1, -1, -1, "KĆ«rybiĆĄkumą", -1, 0, 12, 26, 0, 1, "AIM ITS/04-023:2022 ECI 12 Example 1 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, "10101010101010101010101010" "10010010000111001101100011" "10011111110110110110111000" @@ -3254,7 +3352,7 @@ static void test_encode(const testCtx *const p_ctx) { "10011101110100000011000100" "11111111111111111111111111" }, - /* 88*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 12, -1, -1, -1, "KĆ«rybiĆĄkumą", -1, 0, 12, 26, 1, 1, "AIM ITS/04-023:2022 ECI 12 Example 1 **NOT SAME** different encodation", 0, + /* 91*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 12, -1, -1, -1, "KĆ«rybiĆĄkumą", -1, 0, 12, 26, 1, 1, "AIM ITS/04-023:2022 ECI 12 Example 1 **NOT SAME** different encodation", 0, "10101010101010101010101010" "10011110000111001010011111" "10010001010110110011110000" @@ -3268,7 +3366,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000101010100110000011010" "11111111111111111111111111" }, - /* 89*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 13, -1, -1, -1, "àžšàžČàžŁàč‹àčàž„àčˆàž”", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 13 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + /* 92*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 13, -1, -1, -1, "àžšàžČàžŁàč‹àčàž„àčˆàž”", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 13 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, "1010101010101010" "1001110100011001" "1001101111101000" @@ -3286,7 +3384,7 @@ static void test_encode(const testCtx *const p_ctx) { "1001010001001010" "1111111111111111" }, - /* 90*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 15, -1, -1, -1, "uzƆēmums", -1, 0, 16, 16, 0, 1, "AIM ITS/04-023:2022 ECI 15 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, + /* 93*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 15, -1, -1, -1, "uzƆēmums", -1, 0, 16, 16, 0, 1, "AIM ITS/04-023:2022 ECI 15 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, "1010101010101010" "1001101111101001" "1010110111010100" @@ -3304,7 +3402,7 @@ static void test_encode(const testCtx *const p_ctx) { "1110011001011010" "1111111111111111" }, - /* 91*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 16, -1, -1, -1, "áčĂłráčĄĂĄÄ‹", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 16 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + /* 94*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 16, -1, -1, -1, "áčĂłráčĄĂĄÄ‹", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 16 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010101010101010101010" "10011101001100111111001100100101" "10101011110110101011000000111100" @@ -3314,7 +3412,7 @@ static void test_encode(const testCtx *const p_ctx) { "11101100010001001001011110100100" "11111111111111111111111111111111" }, - /* 92*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, -1, -1, -1, "Price: €13.50", -1, 0, 12, 26, 1, 1, "AIM ITS/04-023:2022 ECI 17 Example 1", 0, + /* 95*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, -1, -1, -1, "Price: €13.50", -1, 0, 12, 26, 1, 1, "AIM ITS/04-023:2022 ECI 17 Example 1", 0, "10101010101010101010101010" "10000111000111101110001001" "10100101110010111101000010" @@ -3328,7 +3426,7 @@ static void test_encode(const testCtx *const p_ctx) { "10100111000100011110100110" "11111111111111111111111111" }, - /* 93*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 18, -1, -1, -1, "Te sƂowa są gƂębokie", -1, 0, 22, 22, 0, 1, "AIM ITS/04-023:2022 ECI 18 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, + /* 96*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 18, -1, -1, -1, "Te sƂowa są gƂębokie", -1, 0, 22, 22, 0, 1, "AIM ITS/04-023:2022 ECI 18 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, "1010101010101010101010" "1001011001001010011011" "1010001101110111011000" @@ -3352,7 +3450,7 @@ static void test_encode(const testCtx *const p_ctx) { "1011000010010101000110" "1111111111111111111111" }, - /* 94*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 20, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 12, 26, 0, 1, "AIM ITS/04-023:2022 ECI 20 Example 1 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, + /* 97*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 20, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 12, 26, 0, 1, "AIM ITS/04-023:2022 ECI 20 Example 1 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, "10101010101010101010101010" "10011110011111011010110101" "10100100010101100010110110" @@ -3366,7 +3464,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000110001100101101001010" "11111111111111111111111111" }, - /* 95*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 20, -1, -1, DM_SQUARE, "東äșŹéƒœ", -1, 0, 16, 16, 0, 1, "AIM ITS/04-023:2022 ECI 20 Example 2 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, + /* 98*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 20, -1, -1, DM_SQUARE, "東äșŹéƒœ", -1, 0, 16, 16, 0, 1, "AIM ITS/04-023:2022 ECI 20 Example 2 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, "1010101010101010" "1001110111101011" "1010011001101010" @@ -3384,7 +3482,7 @@ static void test_encode(const testCtx *const p_ctx) { "1010010001000010" "1111111111111111" }, - /* 96*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 21, -1, -1, -1, "Ć tudentska ĆĄt. 2198390", -1, 0, 20, 20, 0, 1, "AIM ITS/04-023:2022 ECI 21 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, + /* 99*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 21, -1, -1, -1, "Ć tudentska ĆĄt. 2198390", -1, 0, 20, 20, 0, 1, "AIM ITS/04-023:2022 ECI 21 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, "10101010101010101010" "10001100100001100111" "10100101100110111110" @@ -3406,7 +3504,7 @@ static void test_encode(const testCtx *const p_ctx) { "11010010011010100010" "11111111111111111111" }, - /* 97*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 22, -1, -1, DM_SQUARE, "Đ ĐŸŃŃĐžŃ", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 22 Example 1", 0, + /*100*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 22, -1, -1, DM_SQUARE, "Đ ĐŸŃŃĐžŃ", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 22 Example 1", 0, "1010101010101010" "1001110111011111" "1010101011100000" @@ -3424,7 +3522,7 @@ static void test_encode(const testCtx *const p_ctx) { "1011010001101010" "1111111111111111" }, - /* 98*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 22, -1, -1, DM_SQUARE, "ĐœĐŸĐœĐłĐŸĐ»ŃƒĐ»Ń", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 22 Example 2", 0, + /*101*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 22, -1, -1, DM_SQUARE, "ĐœĐŸĐœĐłĐŸĐ»ŃƒĐ»Ń", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 22 Example 2", 0, "101010101010101010" "100111100100010101" "101010000001111110" @@ -3444,7 +3542,7 @@ static void test_encode(const testCtx *const p_ctx) { "101100011000000110" "111111111111111111" }, - /* 99*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 23, -1, -1, -1, "bƓuf", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 23 Example 1", 0, + /*102*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 23, -1, -1, -1, "bƓuf", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 23 Example 1", 0, "10101010101010" "10001110110001" "10110001110100" @@ -3460,7 +3558,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000001001110" "11111111111111" }, - /*100*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 24, -1, -1, DM_SQUARE, "ŰŹÙˆŰ§ŰČ Ű§Ù„ŰłÙŰ±", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 24 Example 1", 0, + /*103*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 24, -1, -1, DM_SQUARE, "ŰŹÙˆŰ§ŰČ Ű§Ù„ŰłÙŰ±", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 24 Example 1", 0, "101010101010101010" "100111100010000001" "101110001110110010" @@ -3480,7 +3578,7 @@ static void test_encode(const testCtx *const p_ctx) { "110100011110001010" "111111111111111111" }, - /*101*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 24, -1, -1, -1, "Ű§Ù„Ù…Ù†ŰŽŰŁ: Ű§Ù„Ù…Ù…Ù„ÙƒŰ© Ű§Ù„ŰčŰ±ŰšÙŠŰ© Ű§Ù„ŰłŰčÙˆŰŻÙŠŰ©", -1, 0, 24, 24, 1, 1, "AIM ITS/04-023:2022 ECI 24 Example 2", 0, + /*104*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 24, -1, -1, -1, "Ű§Ù„Ù…Ù†ŰŽŰŁ: Ű§Ù„Ù…Ù…Ù„ÙƒŰ© Ű§Ù„ŰčŰ±ŰšÙŠŰ© Ű§Ù„ŰłŰčÙˆŰŻÙŠŰ©", -1, 0, 24, 24, 1, 1, "AIM ITS/04-023:2022 ECI 24 Example 2", 0, "101010101010101010101010" "100111010010001001001011" "101110111100001110010010" @@ -3506,7 +3604,7 @@ static void test_encode(const testCtx *const p_ctx) { "101111000110001010111010" "111111111111111111111111" }, - /*102*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 25, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 25 Example 1", 0, + /*105*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 25, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 25 Example 1", 0, "10101010101010" "10000010011111" "10110101011100" @@ -3522,7 +3620,7 @@ static void test_encode(const testCtx *const p_ctx) { "10011101010100" "11111111111111" }, - /*103*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 25, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 12, 26, 1, 1, "AIM ITS/04-023:2022 ECI 25 Example 2", 0, + /*106*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 25, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 12, 26, 1, 1, "AIM ITS/04-023:2022 ECI 25 Example 2", 0, "10101010101010101010101010" "10011110010000001001101001" "10110000101111001011001010" @@ -3536,7 +3634,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000100100011011100111100" "11111111111111111111111111" }, - /*104*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 25, -1, -1, -1, "바윔드", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 25 Example 3 **NOT SAME** example sets explicit BASE256 byte count", 0, + /*107*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 25, -1, -1, -1, "바윔드", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 25 Example 3 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010101010101010101010" "10011101000111111101100100000101" "10111011100010101000011111001100" @@ -3546,7 +3644,7 @@ static void test_encode(const testCtx *const p_ctx) { "11110100011001101010111111010110" "11111111111111111111111111111111" }, - /*105*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, DM_SQUARE, "æĄç ", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 26 Example 1", 0, + /*108*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, DM_SQUARE, "æĄç ", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 26 Example 1", 0, "1010101010101010" "1001110111110101" "1011111011000100" @@ -3564,7 +3662,7 @@ static void test_encode(const testCtx *const p_ctx) { "1001110001111010" "1111111111111111" }, - /*106*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 20, 20, 1, 1, "AIM ITS/04-023:2022 ECI 26 Example 2", 0, + /*109*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 20, 20, 1, 1, "AIM ITS/04-023:2022 ECI 26 Example 2", 0, "10101010101010101010" "10011110001010000111" "10111111000100111110" @@ -3586,7 +3684,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000101001001010010" "11111111111111111111" }, - /*107*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 26 Example 3", 0, + /*110*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 26 Example 3", 0, "101010101010101010" "100111100000010101" "101111000110111110" @@ -3606,7 +3704,7 @@ static void test_encode(const testCtx *const p_ctx) { "101100010110000100" "111111111111111111" }, - /*108*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 27, -1, -1, -1, "sn:7QPB4MN", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 27 Example 1", 0, + /*111*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 27, -1, -1, -1, "sn:7QPB4MN", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 27 Example 1", 0, "1010101010101010" "1001001011000001" "1011111111011000" @@ -3624,7 +3722,7 @@ static void test_encode(const testCtx *const p_ctx) { "1001011001110010" "1111111111111111" }, - /*109*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 28, -1, -1, -1, "æąçąŒ", -1, 0, 14, 14, 0, 1, "AIM ITS/04-023:2022 ECI 28 Example 1 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example except does not set explicit BASE256 byte count", 0, + /*112*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 28, -1, -1, -1, "æąçąŒ", -1, 0, 14, 14, 0, 1, "AIM ITS/04-023:2022 ECI 28 Example 1 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example except does not set explicit BASE256 byte count", 0, "10101010101010" "10011101101111" "10111001001100" @@ -3640,7 +3738,7 @@ static void test_encode(const testCtx *const p_ctx) { "10101101000110" "11111111111111" }, - /*110*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 29, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 29 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + /*113*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 29, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 29 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010" "10011101000111" "10111011101100" @@ -3656,7 +3754,7 @@ static void test_encode(const testCtx *const p_ctx) { "11001101000100" "11111111111111" }, - /*111*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 29, -1, -1, -1, "挗äșŹ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 29 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + /*114*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 29, -1, -1, -1, "挗äșŹ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 29 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010" "10011101000101" "10111011100110" @@ -3672,7 +3770,7 @@ static void test_encode(const testCtx *const p_ctx) { "10101101000110" "11111111111111" }, - /*112*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 30, -1, -1, -1, "바윔드", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 30 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + /*115*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 30, -1, -1, -1, "바윔드", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 30 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010101010101010101010" "10011101010000111110011110001101" "10111011100001101011001100110000" @@ -3682,7 +3780,7 @@ static void test_encode(const testCtx *const p_ctx) { "11011100010101101110100010101010" "11111111111111111111111111111111" }, - /*113*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 30, -1, -1, -1, "서욞", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 30 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + /*116*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 30, -1, -1, -1, "서욞", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 30 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010" "10011101010111" "10111011100110" @@ -3698,7 +3796,7 @@ static void test_encode(const testCtx *const p_ctx) { "11001101000110" "11111111111111" }, - /*114*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 31, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 31 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + /*117*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 31, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 31 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010" "10011101010111" "11001011110100" @@ -3714,7 +3812,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000111000100" "11111111111111" }, - /*115*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 31, -1, -1, -1, "挗äșŹ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 31 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + /*118*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 31, -1, -1, -1, "挗äșŹ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 31 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010" "10011101010101" "11001011111110" @@ -3730,7 +3828,7 @@ static void test_encode(const testCtx *const p_ctx) { "10100111000110" "11111111111111" }, - /*116*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 31, -1, -1, -1, "æąçąŒ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 31 Example 3 **NOT SAME** different encodation (example uses binary)", 0, + /*119*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 31, -1, -1, -1, "æąçąŒ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 31 Example 3 **NOT SAME** different encodation (example uses binary)", 0, "10101010101010" "10001101110001" "11000100010000" @@ -3746,7 +3844,7 @@ static void test_encode(const testCtx *const p_ctx) { "10110111010010" "11111111111111" }, - /*117*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 32 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + /*120*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 32 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010" "10011101011111" "11001011111000" @@ -3762,7 +3860,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000001000100" "11111111111111" }, - /*118*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, -1, "挗äșŹ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 32 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + /*121*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, -1, "挗äșŹ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 32 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, "10101010101010" "10011101011101" "11001011110010" @@ -3778,7 +3876,7 @@ static void test_encode(const testCtx *const p_ctx) { "10100001000110" "11111111111111" }, - /*119*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, -1, "æąçąŒ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 32 Example 3 **NOT SAME** different encodation (example uses binary)", 0, + /*122*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, -1, "æąçąŒ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 32 Example 3 **NOT SAME** different encodation (example uses binary)", 0, "10101010101010" "10001101111001" "11000100011100" @@ -3794,7 +3892,7 @@ static void test_encode(const testCtx *const p_ctx) { "10110001010010" "11111111111111" }, - /*120*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, DM_SQUARE, "àœ”àœșàŒ‹àœ…àœČàœ„àŒ", -1, 0, 24, 24, 0, 1, "AIM ITS/04-023:2022 ECI 32 Example 4 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, + /*123*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, DM_SQUARE, "àœ”àœșàŒ‹àœ…àœČàœ„àŒ", -1, 0, 24, 24, 0, 1, "AIM ITS/04-023:2022 ECI 32 Example 4 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, "101010101010101010101010" "100111110000011010000101" "110001010011101011111000" @@ -3820,7 +3918,7 @@ static void test_encode(const testCtx *const p_ctx) { "110001000101110010010010" "111111111111111111111111" }, - /*121*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, DM_SQUARE, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 32 Example 5", 0, + /*124*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, DM_SQUARE, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 18, 18, 1, 1, "AIM ITS/04-023:2022 ECI 32 Example 5", 0, "101010101010101010" "100111100000000001" "110010001111110010" @@ -3840,7 +3938,7 @@ static void test_encode(const testCtx *const p_ctx) { "101100011101111000" "111111111111111111" }, - /*122*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 32 Example 6 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, + /*125*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 32 Example 6 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, "101010101010101010" "100111100000001111" "110001010011000100" @@ -3860,7 +3958,7 @@ static void test_encode(const testCtx *const p_ctx) { "101100010101010110" "111111111111111111" }, - /*123*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 33 Example 1", 0, + /*126*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, -1, -1, -1, "æĄç ", -1, 0, 14, 14, 1, 1, "AIM ITS/04-023:2022 ECI 33 Example 1", 0, "10101010101010" "10001010110111" "11000000010100" @@ -3876,7 +3974,7 @@ static void test_encode(const testCtx *const p_ctx) { "10010001000100" "11111111111111" }, - /*124*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, -1, -1, DM_SQUARE, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 33 Example 2 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, + /*127*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, -1, -1, DM_SQUARE, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 33 Example 2 **NOT SAME** Zint switches to ASCII 1 char before end; BWIPP same as example", 0, "101010101010101010" "100111100010010001" "110010000100110010" @@ -3896,7 +3994,7 @@ static void test_encode(const testCtx *const p_ctx) { "111100010111101010" "111111111111111111" }, - /*125*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, -1, -1, -1, "바윔드", -1, 0, 8, 32, 0, 1, "AIM ITS/04-023:2022 ECI 33 Example 3 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + /*128*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, -1, -1, -1, "바윔드", -1, 0, 8, 32, 0, 1, "AIM ITS/04-023:2022 ECI 33 Example 3 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, "10101010101010101010101010101010" "10010110001111011011011000110101" "11001111111100101000100000101000" @@ -3906,7 +4004,7 @@ static void test_encode(const testCtx *const p_ctx) { "11110010110110101110001111110110" "11111111111111111111111111111111" }, - /*126*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 33, -1, -1, -1, "바윔드", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 33 Example 3 **NOT SAME** different encodation", 0, + /*129*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 33, -1, -1, -1, "바윔드", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 33 Example 3 **NOT SAME** different encodation", 0, "10101010101010101010101010101010" "10011101001111011010111110010101" "11000011111111101000110111000100" @@ -3916,7 +4014,7 @@ static void test_encode(const testCtx *const p_ctx) { "11110100011100101110011010101000" "11111111111111111111111111111111" }, - /*127*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, -1, -1, -1, "æĄç ", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 34 Example 1", 0, + /*130*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, -1, -1, -1, "æĄç ", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 34 Example 1", 0, "10101010101010101010101010101010" "10000100000001011001100100101101" "11000100100001001101100101100100" @@ -3926,7 +4024,7 @@ static void test_encode(const testCtx *const p_ctx) { "11010000001111101100000001100110" "11111111111111111111111111111111" }, - /*128*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 22, 22, 0, 1, "AIM ITS/04-023:2022 ECI 34 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, + /*131*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 22, 22, 0, 1, "AIM ITS/04-023:2022 ECI 34 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, "1010101010101010101010" "1000010001011111000001" "1100000010110010010000" @@ -3950,7 +4048,7 @@ static void test_encode(const testCtx *const p_ctx) { "1101110000000101011100" "1111111111111111111111" }, - /*129*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 34 Example 3 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + /*132*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 34 Example 3 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, "101010101010101010" "100001000101111111" "110011001011000000" @@ -3970,7 +4068,7 @@ static void test_encode(const testCtx *const p_ctx) { "101000000011010110" "111111111111111111" }, - /*130*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 34, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 34 Example 3 **NOT SAME** different encodation", 0, + /*133*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 34, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 34 Example 3 **NOT SAME** different encodation", 0, "101010101010101010" "100111100101111111" "110011011011000000" @@ -3990,7 +4088,7 @@ static void test_encode(const testCtx *const p_ctx) { "101100011111010100" "111111111111111111" }, - /*131*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, -1, -1, -1, "æĄç ", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 35 Example 1", 0, + /*134*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, -1, -1, -1, "æĄç ", -1, 0, 8, 32, 1, 1, "AIM ITS/04-023:2022 ECI 35 Example 1", 0, "10101010101010101010101010101010" "10001010101001011001011111111101" "11000000011111001011101110100000" @@ -4000,7 +4098,7 @@ static void test_encode(const testCtx *const p_ctx) { "11001100011110001000101111100010" "11111111111111111111111111111111" }, - /*132*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 22, 22, 0, 1, "AIM ITS/04-023:2022 ECI 35 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, + /*135*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, -1, -1, -1, "ăƒăƒŒă‚łăƒŒăƒ‰", -1, 0, 22, 22, 0, 1, "AIM ITS/04-023:2022 ECI 35 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, "1010101010101010101010" "1001111010111100010001" "1100100000010110000000" @@ -4024,7 +4122,7 @@ static void test_encode(const testCtx *const p_ctx) { "1000011100010000111100" "1111111111111111111111" }, - /*133*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 35 Example 3 **NOT SAME** different encodation; BWIPP different encodation", 0, + /*136*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, -1, -1, DM_SQUARE, "바윔드", -1, 0, 18, 18, 0, 1, "AIM ITS/04-023:2022 ECI 35 Example 3 **NOT SAME** different encodation; BWIPP different encodation", 0, "101010101010101010" "100101100010110001" "110011111110000010" @@ -4044,7 +4142,7 @@ static void test_encode(const testCtx *const p_ctx) { "110010110111000000" "111111111111111111" }, - /*134*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 170, -1, -1, -1, "sn:7QPB4MN", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 170 Example 1", 0, + /*137*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 170, -1, -1, -1, "sn:7QPB4MN", -1, 0, 16, 16, 1, 1, "AIM ITS/04-023:2022 ECI 170 Example 1", 0, "1010101010101010" "1101001101000101" "1000011000100000" @@ -4062,7 +4160,7 @@ static void test_encode(const testCtx *const p_ctx) { "1101110101101010" "1111111111111111" }, - /*135*/ { BARCODE_DATAMATRIX, DATA_MODE, 899, -1, -1, -1, "\000\001\002\133\134\135\375\376\377", 9, 0, 12, 26, 0, 1, "AIM ITS/04-023:2022 ECI 899 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, + /*138*/ { BARCODE_DATAMATRIX, DATA_MODE, 899, -1, -1, -1, "\000\001\002\133\134\135\375\376\377", 9, 0, 12, 26, 0, 1, "AIM ITS/04-023:2022 ECI 899 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, "10101010101010101010101010" "11001100001001010101010111" "10000000111000111010100110" @@ -4076,7 +4174,7 @@ static void test_encode(const testCtx *const p_ctx) { "10010010000010011010010100" "11111111111111111111111111" }, - /*136*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, 3, -1, -1, -1, "\101\300", -1, 0, 12, 12, 1, 899, "AÀ", 0, + /*139*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, 3, -1, -1, -1, "\101\300", -1, 0, 12, 12, 1, 899, "AÀ", 0, "101010101010" "100010101111" "100001011110" @@ -4090,7 +4188,7 @@ static void test_encode(const testCtx *const p_ctx) { "100011011010" "111111111111" }, - /*137*/ { BARCODE_DATAMATRIX, DATA_MODE, 3, -1, -1, -1, "\101\300", -1, 0, 12, 12, 1, 899, "AÀ", 0, + /*140*/ { BARCODE_DATAMATRIX, DATA_MODE, 3, -1, -1, -1, "\101\300", -1, 0, 12, 12, 1, 899, "AÀ", 0, "101010101010" "100010101111" "100001011110" @@ -4104,7 +4202,7 @@ static void test_encode(const testCtx *const p_ctx) { "100011011010" "111111111111" }, - /*138*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 26, -1, -1, -1, "AÀ", -1, 0, 14, 14, 1, 1, "AÀ", 0, + /*141*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 26, -1, -1, -1, "AÀ", -1, 0, 14, 14, 1, 1, "AÀ", 0, "10101010101010" "10001010100001" "10110101100100" @@ -4120,7 +4218,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000110001100" "11111111111111" }, - /*139*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, -1, "AÀ", -1, 0, 14, 14, 1, 1, "AÀ", 0, + /*142*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, -1, "AÀ", -1, 0, 14, 14, 1, 1, "AÀ", 0, "10101010101010" "10001010100001" "10110101100100" @@ -4136,7 +4234,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000110001100" "11111111111111" }, - /*140*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, -1, -1, -1, DM_SQUARE, "abcdefgh+", -1, 0, 16, 16, 1, 1, "TEX last_shift 2, symbols_left 1, process_p 1", 0, + /*143*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, -1, -1, -1, DM_SQUARE, "abcdefgh+", -1, 0, 16, 16, 1, 1, "TEX last_shift 2, symbols_left 1, process_p 1", 0, "1010101010101010" "1010011011101001" "1011001010010010" @@ -4154,7 +4252,7 @@ static void test_encode(const testCtx *const p_ctx) { "1101110101001010" "1111111111111111" }, - /*141*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, -1, -1, DM_SQUARE, "abcdefgh+", -1, 0, 14, 14, 0, 1, "ATTTTTTTT; BWIPP same as FAST_MODE", 1, + /*144*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, -1, -1, DM_SQUARE, "abcdefgh+", -1, 0, 14, 14, 0, 1, "ATTTTTTTT; BWIPP same as FAST_MODE", 1, "10101010101010" "11100001010101" "11010101001000" @@ -4170,7 +4268,7 @@ static void test_encode(const testCtx *const p_ctx) { "10111011000100" "11111111111111" }, - /*142*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, 899, "7 BASE256s, 1 pad", 0, + /*145*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, 899, "7 BASE256s, 1 pad", 0, "10101010101010101010101010101010" "10000101000011011000110100100001" "11100111110101001011101110100010" @@ -4180,7 +4278,7 @@ static void test_encode(const testCtx *const p_ctx) { "11010000111100001010011101100100" "11111111111111111111111111111111" }, - /*143*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, 899, "7 BASE256s, 1 pad", 0, + /*146*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, 899, "7 BASE256s, 1 pad", 0, "10101010101010101010101010101010" "10000101000011011000110100100001" "11100111110101001011101110100010" @@ -4190,7 +4288,7 @@ static void test_encode(const testCtx *const p_ctx) { "11010000111100001010011101100100" "11111111111111111111111111111111" }, - /*144*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, 899, "8 BASE256s, no padding", 0, + /*147*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, 899, "8 BASE256s, no padding", 0, "10101010101010101010101010101010" "10000101000011011111001101000001" "11010111110101001001011001100010" @@ -4200,7 +4298,7 @@ static void test_encode(const testCtx *const p_ctx) { "11010000110010001001010001111000" "11111111111111111111111111111111" }, - /*145*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, 899, "8 BASE256s, no padding", 0, + /*148*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, 899, "8 BASE256s, no padding", 0, "10101010101010101010101010101010" "10000101000011011111001101000001" "11010111110101001001011001100010" @@ -4210,7 +4308,7 @@ static void test_encode(const testCtx *const p_ctx) { "11010000110010001001010001111000" "11111111111111111111111111111111" }, - /*146*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, DM_SQUARE, "\200\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, 899, "8 BASE256s, square, no padding", 0, + /*149*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, DM_SQUARE, "\200\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, 899, "8 BASE256s, square, no padding", 0, "1010101010101010" "1000010100001101" "1101011111101110" @@ -4228,7 +4326,7 @@ static void test_encode(const testCtx *const p_ctx) { "1111000011111010" "1111111111111111" }, - /*147*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, DM_SQUARE, "\200\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, 899, "8 BASE256s, square, no padding", 0, + /*150*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, DM_SQUARE, "\200\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, 899, "8 BASE256s, square, no padding", 0, "1010101010101010" "1000010100001101" "1101011111101110" @@ -4246,7 +4344,7 @@ static void test_encode(const testCtx *const p_ctx) { "1111000011111010" "1111111111111111" }, - /*148*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, 899, "9 BASE256s, 1 pad", 0, + /*151*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, 899, "9 BASE256s, 1 pad", 0, "1010101010101010" "1000010101001101" "1110011111000010" @@ -4264,7 +4362,7 @@ static void test_encode(const testCtx *const p_ctx) { "1100000011011010" "1111111111111111" }, - /*149*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, 899, "9 BASE256s, 1 pad", 0, + /*152*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, 899, "9 BASE256s, 1 pad", 0, "1010101010101010" "1000010101001101" "1110011111000010" @@ -4282,7 +4380,7 @@ static void test_encode(const testCtx *const p_ctx) { "1100000011011010" "1111111111111111" }, - /*150*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 22, 22, 1, 899, "22 BASE256s, 6 pads", 0, + /*153*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 22, 22, 1, 899, "22 BASE256s, 6 pads", 0, "1010101010101010101010" "1010010100011100010101" "1000011110111110001100" @@ -4306,7 +4404,7 @@ static void test_encode(const testCtx *const p_ctx) { "1111101000110111010100" "1111111111111111111111" }, - /*151*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 22, 22, 1, 899, "22 BASE256s, 6 pads", 0, + /*154*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 22, 22, 1, 899, "22 BASE256s, 6 pads", 0, "1010101010101010101010" "1010010100011100010101" "1000011110111110001100" @@ -4330,7 +4428,7 @@ static void test_encode(const testCtx *const p_ctx) { "1111101000110111010100" "1111111111111111111111" }, - /*152*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, DM_DMRE, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 8, 64, 1, 899, "22 BASE256s, no padding", 0, + /*155*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, DM_DMRE, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 8, 64, 1, 899, "22 BASE256s, no padding", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010101100011101010101011101111110100100110011100010011010111" "1101011110001010110000001110001010001011010111001010101101100000" @@ -4340,7 +4438,7 @@ static void test_encode(const testCtx *const p_ctx) { "1101000011001010111101101101110010111100111101001010010011001000" "1111111111111111111111111111111111111111111111111111111111111111" }, - /*153*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, DM_DMRE, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 8, 64, 1, 899, "22 BASE256s, no padding", 0, + /*156*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, DM_DMRE, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 8, 64, 1, 899, "22 BASE256s, no padding", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010101100011101010101011101111110100100110011100010011010111" "1101011110001010110000001110001010001011010111001010101101100000" @@ -4350,7 +4448,7 @@ static void test_encode(const testCtx *const p_ctx) { "1101000011001010111101101101110010111100111101001010010011001000" "1111111111111111111111111111111111111111111111111111111111111111" }, - /*154*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 1, 899, "249 BASE256s + 6 ASCII (3 double-digits)", 0, + /*157*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 1, 899, "249 BASE256s + 6 ASCII (3 double-digits)", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010100011101100000010111100110100010110111011011111010000001" "1100011110111110100110111101111010101101000010001101001011001100" @@ -4416,7 +4514,7 @@ static void test_encode(const testCtx *const p_ctx) { "1000001101010100110010010110101010000000001010101100100011101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /*155*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 1, 899, "249 BASE256s + 6 ASCII (3 double-digits)", 0, + /*158*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 1, 899, "249 BASE256s + 6 ASCII (3 double-digits)", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010100011101100000010111100110100010110111011011111010000001" "1100011110111110100110111101111010101101000010001101001011001100" @@ -4482,7 +4580,7 @@ static void test_encode(const testCtx *const p_ctx) { "1000001101010100110010010110101010000000001010101100100011101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /*156*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 0, 899, "249 BASE256s + 8 ASCII (Sh A80 + 3 double-digits); BWIPP uses 2nd B256 length byte instead of ASCII shift (same no. of codewords)", 0, + /*159*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 0, 899, "249 BASE256s + 8 ASCII (Sh A80 + 3 double-digits); BWIPP uses 2nd B256 length byte instead of ASCII shift (same no. of codewords)", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010100011101100000010111100110100010110111011011111010000001" "1100011110111110100110111101111010101101000010001101001011001100" @@ -4548,7 +4646,7 @@ static void test_encode(const testCtx *const p_ctx) { "1000001101010100110100010100101010001100001000101100101001101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /*157*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 0, 899, "249 BASE256s + 8 ASCII (Sh A80 + 3 double-digits); BWIPP uses 2nd B256 length byte instead of ASCII shift (same no. of codewords)", 0, + /*160*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 0, 899, "249 BASE256s + 8 ASCII (Sh A80 + 3 double-digits); BWIPP uses 2nd B256 length byte instead of ASCII shift (same no. of codewords)", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010100011101100000010111100110100010110111011011111010000001" "1100011110111110100110111101111010101101000010001101001011001100" @@ -4614,7 +4712,7 @@ static void test_encode(const testCtx *const p_ctx) { "1000001101010100110100010100101010001100001000101100101001101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /*158*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 1, 899, "10 ASCII + 251 BASE256s + 6 ASCII", 0, + /*161*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 1, 899, "10 ASCII + 251 BASE256s + 6 ASCII", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1010011010011101100000010111100110100010110111011011111010000001" "1011001010111110100110111101111010101101000010001101001011001100" @@ -4680,7 +4778,7 @@ static void test_encode(const testCtx *const p_ctx) { "1001010101010100111010010100101010000010001011001100101011101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /*159*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 0, 899, "10 ASCII + 251 BASE256s + 6 ASCII; BWIPP same as FAST_MODE", 0, + /*162*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 64, 64, 0, 899, "10 ASCII + 251 BASE256s + 6 ASCII; BWIPP same as FAST_MODE", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1010011010011101100000010111100110100010110111011011111010000001" "1011001010111110100110111101111010101101000010001101001011001100" @@ -4746,7 +4844,7 @@ static void test_encode(const testCtx *const p_ctx) { "1001010101010100111110010100001010001100001000001100100011101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /*160*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 88, 88, 1, 899, "10 ASCII + 252 BASE256s + 10 ASCII + 253 BASE256 + 6 ASCII", 0, + /*163*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066", -1, 0, 88, 88, 1, 899, "10 ASCII + 252 BASE256s + 10 ASCII + 253 BASE256 + 6 ASCII", 0, "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "1010011010011100000001110111100010001011011111001111101000000110011111111000100110101111" "1011001010111110011010111101111010110100001010010100101100110010101011111110101001100000" @@ -4836,7 +4934,7 @@ static void test_encode(const testCtx *const p_ctx) { "1101010100110101110000110100001000100000101010010010101110100111001111100010001001001100" "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /*161*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200" "\061\062\063\064\065\066", -1, 0, 88, 88, 0, 899, "10 ASCII + 252 BASE256s + 10 ASCII + 253 BASE256 + 6 ASCII; BWIPP same as FAST_MODE", 0, + /*164*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200" "\061\062\063\064\065\066", -1, 0, 88, 88, 0, 899, "10 ASCII + 252 BASE256s + 10 ASCII + 253 BASE256 + 6 ASCII; BWIPP same as FAST_MODE", 0, "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "1010011010011100000001110111100010001011011111001111101000000110011111111000100110101111" "1011001010111110011010111101111010110100001010010100101100110010101011111110101001100000" @@ -4926,7 +5024,7 @@ static void test_encode(const testCtx *const p_ctx) { "1101010100110101110000110100101000010000100010110010111110101011001111100010000101001100" "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /*162*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 88, 88, 1, 899, "10 ASCII + 252 BASE256s + 10 ASCII + 304 BASE256, no padding", 0, + /*165*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 88, 88, 1, 899, "10 ASCII + 252 BASE256s + 10 ASCII + 304 BASE256, no padding", 0, "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "1010011010011100000001110111100010001011011111001111101000000110011111111000100110101111" "1011001010111110011010111101111010110100001010010100101100110010101011111110101001100000" @@ -5016,7 +5114,7 @@ static void test_encode(const testCtx *const p_ctx) { "1101010100110101100000110110001000001000101011110010001110100101001111000010001111001100" "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /*163*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 88, 88, 0, 899, "10 ASCII + 252 BASE256s + 10 ASCII + 304 BASE256, no padding; BWIPP same as FAST_MODE", 0, + /*166*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\101\102\103\104\105\106\107\110\111\112\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\061\062\063\064\065\066\067\070\071\060\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200", -1, 0, 88, 88, 0, 899, "10 ASCII + 252 BASE256s + 10 ASCII + 304 BASE256, no padding; BWIPP same as FAST_MODE", 0, "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "1010011010011100000001110111100010001011011111001111101000000110011111111000100110101111" "1011001010111110011010111101111010110100001010010100101100110010101011111110101001100000" @@ -5106,7 +5204,7 @@ static void test_encode(const testCtx *const p_ctx) { "1101010100110101100000110110101000111000100011010010011110101001001111000010000011001100" "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /*164*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@_", -1, 0, 8, 32, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 2 chars, not last 3 like Zint", 0, + /*167*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@_", -1, 0, 8, 32, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 2 chars, not last 3 like Zint", 0, "10101010101010101010101010101010" "10000000001001111001101100001101" "10000000000001001001110011001100" @@ -5116,7 +5214,7 @@ static void test_encode(const testCtx *const p_ctx) { "11000000000000001001000001011010" "11111111111111111111111111111111" }, - /*165*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@_", -1, 0, 8, 32, 0, 1, "EDI **NOT SAME** (see FAST_MODE); BWIPP uses different encodation", 0, + /*168*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@_", -1, 0, 8, 32, 0, 1, "EDI **NOT SAME** (see FAST_MODE); BWIPP uses different encodation", 0, "10101010101010101010101010101010" "11100000000000011000100100101001" "11100000000000001010011101001000" @@ -5126,7 +5224,7 @@ static void test_encode(const testCtx *const p_ctx) { "10000000000001001010010000010000" "11111111111111111111111111111111" }, - /*166*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 3 chars, not last 4 like Zint", 0, + /*169*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 3 chars, not last 4 like Zint", 0, "1010101010101010" "1000000001000001" "1000000000111110" @@ -5144,7 +5242,7 @@ static void test_encode(const testCtx *const p_ctx) { "1010100000010010" "1111111111111111" }, - /*167*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@_", -1, 0, 8, 32, 0, 1, "AAEEEEEEEEA; BWIPP uses different encodation, see above", 1, + /*170*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@_", -1, 0, 8, 32, 0, 1, "AAEEEEEEEEA; BWIPP uses different encodation, see above", 1, "10101010101010101010101010101010" "10100000000000111000110101111001" "10000000000001001000100100011000" @@ -5154,7 +5252,7 @@ static void test_encode(const testCtx *const p_ctx) { "10000110001100001001010000001110" "11111111111111111111111111111111" }, - /*168*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 4 chars, not last 1 like Zint", 0, + /*171*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 4 chars, not last 1 like Zint", 0, "1010101010101010" "1000000001000001" "1000000000001100" @@ -5172,7 +5270,7 @@ static void test_encode(const testCtx *const p_ctx) { "1000100000100010" "1111111111111111" }, - /*169*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "AAAEEEEEEEEA; BWIPP uses different encodation, see above", 0, + /*172*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "AAAEEEEEEEEA; BWIPP uses different encodation, see above", 0, "1010101010101010" "1010011101000001" "1000000000101000" @@ -5190,7 +5288,7 @@ static void test_encode(const testCtx *const p_ctx) { "1011000011010010" "1111111111111111" }, - /*170*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 5 chars, not last 2 like Zint", 0, + /*173*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 5 chars, not last 2 like Zint", 0, "1010101010101010" "1000000000100001" "1000000000111000" @@ -5208,7 +5306,7 @@ static void test_encode(const testCtx *const p_ctx) { "1011100000010010" "1111111111111111" }, - /*171*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "EEEEEEEEEEEEA; BWIPP uses different encodation, see above", 1, + /*174*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "EEEEEEEEEEEEA; BWIPP uses different encodation, see above", 1, "1010101010101010" "1000000001100001" "1000000000110100" @@ -5226,7 +5324,7 @@ static void test_encode(const testCtx *const p_ctx) { "1000000000100010" "1111111111111111" }, - /*172*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@@@_", -1, 0, 12, 26, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 2 chars, not last 3 like Zint", 0, + /*175*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@@@_", -1, 0, 12, 26, 0, 1, "EDI; BWIPP uses different encodation, switching to ASC for last 2 chars, not last 3 like Zint", 0, "10101010101010101010101010" "10000000001001100100101011" "10000000000010000000111000" @@ -5240,7 +5338,7 @@ static void test_encode(const testCtx *const p_ctx) { "10000001000001101011010000" "11111111111111111111111111" }, - /*173*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "AEEEEEEEEEEEEA; BWIPP uses different encodation, see above", 1, + /*176*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@@@_", -1, 0, 16, 16, 0, 1, "AEEEEEEEEEEEEA; BWIPP uses different encodation, see above", 1, "1010101010101010" "1110000001000001" "1110000001000000" @@ -5258,7 +5356,7 @@ static void test_encode(const testCtx *const p_ctx) { "1001100000111010" "1111111111111111" }, - /*174*/ { BARCODE_DATAMATRIX, FAST_MODE, 26, -1, -1, -1, "abcdefghi1234FGHIJKLMNabc@@@@@@@@@Ă©", -1, 0, 24, 24, 0, 1, "Mix of modes TEX ASC C40 ASC EDI BAS; BWIPP uses different encodation", 0, + /*177*/ { BARCODE_DATAMATRIX, FAST_MODE, 26, -1, -1, -1, "abcdefghi1234FGHIJKLMNabc@@@@@@@@@Ă©", -1, 0, 24, 24, 0, 1, "Mix of modes TEX ASC C40 ASC EDI BAS; BWIPP uses different encodation", 0, "101010101010101010101010" "100111011110011101000101" "101111001100101101101000" @@ -5284,7 +5382,7 @@ static void test_encode(const testCtx *const p_ctx) { "111101010110111111111010" "111111111111111111111111" }, - /*175*/ { BARCODE_DATAMATRIX, -1, 26, -1, -1, -1, "abcdefghi1234FGHIJKLMNabc@@@@@@@@@Ă©", -1, 0, 24, 24, 0, 1, "TTTTTTTTTAAAACCCCCCCCCAAAAAEEEEEEEAA; BWIPP uses different encodation", 0, + /*178*/ { BARCODE_DATAMATRIX, -1, 26, -1, -1, -1, "abcdefghi1234FGHIJKLMNabc@@@@@@@@@Ă©", -1, 0, 24, 24, 0, 1, "TTTTTTTTTAAAACCCCCCCCCAAAAAEEEEEEEAA; BWIPP uses different encodation", 0, "101010101010101010101010" "100111011110011100000101" "101111001100101100111100" @@ -5310,7 +5408,7 @@ static void test_encode(const testCtx *const p_ctx) { "111011010111011111010010" "111111111111111111111111" }, - /*176*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ;<>@[]_`~!||()?{}'123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678912345678912345678912345678900001234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^;<>@[]_`~!||()?{}'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^;<>@[]_`~!||()?{}'\001\002\003\004\005\006...............\015\015\015\015\015\015\015\015abcdefghijklmnopqrstuvwxyz\015\015\015\015\015\015\015\015...............\001\002\003\004\005\006ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^...............", -1, 0, 132, 132, 0, 1, "Mixed modes (except B256); BWIPP different encodation", 0, + /*179*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ;<>@[]_`~!||()?{}'123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678912345678912345678912345678900001234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^;<>@[]_`~!||()?{}'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^;<>@[]_`~!||()?{}'\001\002\003\004\005\006...............\015\015\015\015\015\015\015\015abcdefghijklmnopqrstuvwxyz\015\015\015\015\015\015\015\015...............\001\002\003\004\005\006ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^...............", -1, 0, 132, 132, 0, 1, "Mixed modes (except B256); BWIPP different encodation", 0, "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "101001101001010011000111100011111001011001011010011010010111111101110111100110110110000111110000111000011100111110111010111110010101" "101100101010110110010011000010100000111010101111010100001111001010100011010100110101000010101011010001111011001010111111011000100110" @@ -5444,7 +5542,7 @@ static void test_encode(const testCtx *const p_ctx) { "110101010100010111111010100000000000110011101101010011010100111010111011101111011111110010101110001010101110001010111111010011111110" "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /*177*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ;<>@[]_`~!||()?{}'123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678912345678912345678912345678900001234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^;<>@[]_`~!||()?{}'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^;<>@[]_`~!||()?{}'\001\002\003\004\005\006...............\015\015\015\015\015\015\015\015abcdefghijklmnopqrstuvwxyz\015\015\015\015\015\015\015\015...............\001\002\003\004\005\006ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^...............", -1, 0, 120, 120, 0, 1, "Mixed modes (except B256); BWIPP uses different encodation", 13, + /*180*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ;<>@[]_`~!||()?{}'123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678912345678912345678912345678900001234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^;<>@[]_`~!||()?{}'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^;<>@[]_`~!||()?{}'\001\002\003\004\005\006...............\015\015\015\015\015\015\015\015abcdefghijklmnopqrstuvwxyz\015\015\015\015\015\015\015\015...............\001\002\003\004\005\006ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz&,:#-.$/+%*=^...............", -1, 0, 120, 120, 0, 1, "Mixed modes (except B256); BWIPP uses different encodation", 13, "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "101001101001010011011001100011111001011110010010011011010111111101001110101111111010000001101101101110110111111011101011" "101100101010110110001101000010100000111010101111010101000000110001110101001100101001111100111000101011100101101011001100" @@ -5566,7 +5664,7 @@ static void test_encode(const testCtx *const p_ctx) { "100101110101110001001111111010101000000010110011011101000010101010011100100101101101011100100110001010000010100000111110" "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /*178*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", -1, 0, 144, 144, 1, 1, "144 x 144 default (de facto) format", 0, + /*181*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", -1, 0, 144, 144, 1, 1, "144 x 144 default (de facto) format", 0, "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "101111011100011110111101111100011110111101110001111110111101110001111011111101110001111011110111110001111011110111000111111011110111000111101111" "101110001111011110111000101111011110111000111100111110111000111101111010111000111101111011100010111101111011100011110110111011100011110111101110" @@ -5712,7 +5810,7 @@ static void test_encode(const testCtx *const p_ctx) { "110100111101111011100010111101111011100101110100110011101011110111101110101011110100001110100110110111001110110111011100101110100111011110111000" "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /*179*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, DM_ISO_144, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", -1, 0, 144, 144, 0, 1, "144 x 144 ISO format; BWIPP not implemented yet TODO: implement", 0, + /*182*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, DM_ISO_144, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", -1, 0, 144, 144, 0, 1, "144 x 144 ISO format; BWIPP not implemented yet TODO: implement", 0, "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "101111011100011110111101111100011110111101110001111110111101110001111011111101110001111011110111110001111011110111000111111011110111000111101111" "101110001111011110111000101111011110111000111100111110111000111101111010111000111101111011100010111101111011100011110110111011100011110111101110" @@ -5858,6 +5956,34 @@ static void test_encode(const testCtx *const p_ctx) { "110100111101111011100010111101111011101111110100110011101001110100001110100011110100001110100110110111001110111111011110101110101111011000111000" "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, + /*183*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 26, -1, -1, -1, "バ\\^1ăƒŒă‚ł\\^1ăƒŒăƒ‰\\^1東äșŹ\\^1郜", -1, 0, 26, 26, 1, 1, "", 0, + "10101010101010101010101010" + "10011101101010000100110011" + "10111101001000110010110100" + "10110011010100111111101111" + "10001110001110100111000110" + "11000011111010011110001001" + "10101010110001001011111110" + "10111001100111011000100111" + "10001100111011000101000000" + "11111010001000011111110001" + "11001000110001110000111100" + "11110101101100111101001111" + "11110111000010110000100100" + "10001111110110101000011001" + "10001101101011001000000110" + "11000000000101000110000001" + "11110000001100100101110110" + "11010111100111100100001101" + "10011111011010010001011110" + "10100100110001111100001011" + "10011000100010011010100010" + "10101110001101011111101101" + "10011110110111111010000010" + "11111101101000010010001001" + "10010001000010011010001010" + "11111111111111111111111111" + }, }; const int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -5953,6 +6079,7 @@ static void test_encode(const testCtx *const p_ctx) { && data[i].option_3 == data[i - 1].option_3 && data[i].output_options == data[i - 1].output_options && strcmp(data[i].data, data[i - 1].data) == 0) { + char *fncs = (char *) z_alloca(length); unsigned char binary[2][2200]; int gs1; int binlen; @@ -5969,7 +6096,8 @@ static void test_encode(const testCtx *const p_ctx) { symbol->input_mode = data[i - 1].input_mode; gs1 = (symbol->input_mode & 0x07) != GS1_MODE ? 0 : (symbol->output_options & GS1_GS_SEPARATOR) ? 2 : 1; - ret = zint_test_dm_encode(symbol, ZCUCP(data[i].data), length, symbol->eci, last_seg, gs1, + memset(fncs, gs1 == 1, length); + ret = zint_test_dm_encode(symbol, ZCUCP(data[i].data), length, symbol->eci, last_seg, fncs, 0 /*b256_end*/, 0 /*c40_end*/, binary[0], &binlen); assert_zero(ret, "i:%d dm_encode() FAST_MODE ret %d != 0 (%s)\n", i, ret, symbol->errtxt); @@ -5979,7 +6107,8 @@ static void test_encode(const testCtx *const p_ctx) { symbol->input_mode = data[i].input_mode; gs1 = (symbol->input_mode & 0x07) != GS1_MODE ? 0 : (symbol->output_options & GS1_GS_SEPARATOR) ? 2 : 1; - ret = zint_test_dm_encode(symbol, ZCUCP(data[i].data), length, symbol->eci, last_seg, gs1, + memset(fncs, gs1 == 1, length); + ret = zint_test_dm_encode(symbol, ZCUCP(data[i].data), length, symbol->eci, last_seg, fncs, 0 /*b256_end*/, 0 /*c40_end*/, binary[1], &binlen); assert_zero(ret, "i:%d dm_encode() minimal ret %d != 0 (%s)\n", i, ret, symbol->errtxt); @@ -6021,6 +6150,7 @@ static void test_encode_segs(const testCtx *const p_ctx) { const char *comment; const char *expected; }; + /* s/\v(\/\*)[ 0-9]*(\*\/)/\=printf("%s%3d%s", submatch(1), (@z+setreg('z',@z+1)), submatch(2))/ | let @z=0: */ static const struct item data[] = { /* 0*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, -1, -1, -1, { 0, 0, "" }, { { TU("¶"), -1, 0 }, { TU("Ж"), -1, 7 }, { TU(""), 0, 0 } }, 0, 14, 14, 1, "ISO 16022:2006 11.6 example", "10101010101010" @@ -6474,6 +6604,30 @@ static void test_encode_segs(const testCtx *const p_ctx) { "11011111000111101101110011110000" "11111111111111111111111111111111" }, + /* 19*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, -1, -1, -1, -1, { 0, 0, "" }, { { TU("AB\\^1CDEFGHIJ\\^1"), -1, 3 }, { TU("\\^1K\\^1L"), -1, 4 }, { TU("M\\^1N\\^1"), -1, 5 } }, 0, 22, 22, 1, "", + "1010101010101010101010" + "1001100111100100010011" + "1000110011011110100100" + "1100011110001011000001" + "1010010111010000111000" + "1110111110001000110111" + "1101100111100101001100" + "1101000010110101111111" + "1100000100001010111110" + "1101100011111011110001" + "1001111011110010101100" + "1101110011101101100101" + "1000001101110101100000" + "1100010000100111011101" + "1111000011010101100100" + "1011100100110100011011" + "1101011111111100100110" + "1010000100101011110011" + "1001111111001100000000" + "1111101110111001101001" + "1111001100011111100010" + "1111111111111111111111" + }, }; const int data_size = ARRAY_SIZE(data); int i, j, seg_count, ret; @@ -6627,14 +6781,20 @@ static void test_ct(const testCtx *const p_ctx) { /* 8*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, "Ă©", -1, 0, 26, "", -1, 0 }, /* 9*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, BARCODE_CONTENT_SEGS, "Ă©", -1, 0, 26, "Ă©", -1, 26 }, /* 10*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 899, -1, "Ă©", -1, 0, 899, "", -1, 0 }, - /* 11*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 899, BARCODE_CONTENT_SEGS, "Ă©", -1, 0, 899, "Ă©", -1, 899 }, - /* 12*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 0, "", -1, 0 }, - /* 13*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, BARCODE_CONTENT_SEGS, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 0, "01049123451234591597033130128\03510ABC123", -1, 3 }, - /* 14*/ { BARCODE_DATAMATRIX, GS1_MODE, 28, BARCODE_CONTENT_SEGS, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 28, "01049123451234591597033130128\03510ABC123", -1, 3 }, /* Note: content seg ECI remains at default 3 */ - /* 15*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, "https://example.com/01/09506000134369", -1, 0, 0, "", -1, 0 }, - /* 16*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, BARCODE_CONTENT_SEGS, "https://example.com/01/09506000134369", -1, 0, 0, "https://example.com/01/09506000134369", -1, 3 }, - /* 17*/ { BARCODE_HIBC_DM, UNICODE_MODE, -1, -1, "H123ABC01234567890", -1, 0, 0, "", -1, 0 }, - /* 18*/ { BARCODE_HIBC_DM, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "H123ABC01234567890", -1, 0, 0, "+H123ABC01234567890D", -1, 3 }, + /* 11*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, -1, -1, "\\^1Ă©", -1, 0, 0, "", -1, 0 }, + /* 12*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, -1, BARCODE_CONTENT_SEGS, "\\^1Ă©", -1, 0, 0, "Ă©", -1, 3 }, + /* 13*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 899, BARCODE_CONTENT_SEGS, "Ă©", -1, 0, 899, "Ă©", -1, 899 }, + /* 14*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 26, -1, "Ă©\\^1", -1, 0, 26, "", -1, 0 }, + /* 15*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 26, BARCODE_CONTENT_SEGS, "Ă©\\^1", -1, 0, 26, "Ă©\035", -1, 26 }, + /* 16*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 26, -1, "\\^^Ă©\\^1\\^1\\^", -1, 0, 26, "", -1, 0 }, + /* 17*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 26, BARCODE_CONTENT_SEGS, "\\^^Ă©\\^1\\^1\\^", -1, 0, 26, "\\^Ă©\035\035\\^", -1, 26 }, + /* 18*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 0, "", -1, 0 }, + /* 19*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, BARCODE_CONTENT_SEGS, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 0, "01049123451234591597033130128\03510ABC123", -1, 3 }, + /* 20*/ { BARCODE_DATAMATRIX, GS1_MODE, 28, BARCODE_CONTENT_SEGS, "[01]04912345123459[15]970331[30]128[10]ABC123", -1, 0, 28, "01049123451234591597033130128\03510ABC123", -1, 3 }, /* Note: content seg ECI remains at default 3 */ + /* 21*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, -1, "https://example.com/01/09506000134369", -1, 0, 0, "", -1, 0 }, + /* 22*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, BARCODE_CONTENT_SEGS, "https://example.com/01/09506000134369", -1, 0, 0, "https://example.com/01/09506000134369", -1, 3 }, + /* 23*/ { BARCODE_HIBC_DM, UNICODE_MODE, -1, -1, "H123ABC01234567890", -1, 0, 0, "", -1, 0 }, + /* 24*/ { BARCODE_HIBC_DM, UNICODE_MODE, -1, BARCODE_CONTENT_SEGS, "H123ABC01234567890", -1, 0, 0, "+H123ABC01234567890D", -1, 3 }, }; const int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -6670,8 +6830,11 @@ static void test_ct(const testCtx *const p_ctx) { assert_nonnull(symbol->content_segs, "i:%d content_segs NULL\n", i); assert_nonnull(symbol->content_segs[0].source, "i:%d content_segs[0].source NULL\n", i); assert_equal(symbol->content_segs[0].length, expected_length, - "i:%d content_segs[0].length %d != expected_length %d\n", - i, symbol->content_segs[0].length, expected_length); + "i:%d content_segs[0].length %d != expected_length %d (%s, %s)\n", + i, symbol->content_segs[0].length, expected_length, + testUtilEscape((const char *) symbol->content_segs[0].source, symbol->content_segs[0].length, + escaped, sizeof(escaped)), + testUtilEscape(data[i].expected, expected_length, escaped2, sizeof(escaped2))); assert_zero(memcmp(symbol->content_segs[0].source, data[i].expected, expected_length), "i:%d content_segs[0].source memcmp(%s, %s, %d) != 0\n", i, testUtilEscape((const char *) symbol->content_segs[0].source, symbol->content_segs[0].length, @@ -7829,6 +7992,7 @@ static void test_minimalenc(const testCtx *const p_ctx) { testStartSymbol(p_ctx->func_name, &symbol); for (i = 0; i < data_size; i++) { + char *fncs; if (testContinue(p_ctx, i)) continue; @@ -7839,10 +8003,12 @@ static void test_minimalenc(const testCtx *const p_ctx) { -1 /*option_1*/, data[i].option_2, -1, data[i].output_options, data[i].data, data[i].length, debug); + fncs = (char *) z_alloca(length); binlen = 0; symbol->input_mode |= FAST_MODE; gs1 = (symbol->input_mode & 0x07) != GS1_MODE ? 0 : (symbol->output_options & GS1_GS_SEPARATOR) ? 2 : 1; - ret = zint_test_dm_encode(symbol, ZCUCP(data[i].data), length, symbol->eci, last_seg, gs1, + memset(fncs, gs1 == 1, length); + ret = zint_test_dm_encode(symbol, ZCUCP(data[i].data), length, symbol->eci, last_seg, fncs, 0 /*b256_end*/, 0 /*c40_end*/, binary[0], &binlen); assert_equal(ret, data[i].ret, "i:%d dm_encode() FAST_MODE ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); @@ -7852,7 +8018,8 @@ static void test_minimalenc(const testCtx *const p_ctx) { binlen = 0; symbol->input_mode &= ~FAST_MODE; gs1 = (symbol->input_mode & 0x07) != GS1_MODE ? 0 : (symbol->output_options & GS1_GS_SEPARATOR) ? 2 : 1; - ret = zint_test_dm_encode(symbol, ZCUCP(data[i].data), length, symbol->eci, last_seg, gs1, + memset(fncs, gs1 == 1, length); + ret = zint_test_dm_encode(symbol, ZCUCP(data[i].data), length, symbol->eci, last_seg, fncs, 0 /*b256_end*/, 0 /*c40_end*/, binary[1], &binlen); assert_equal(ret, data[i].ret, "i:%d dm_encode() minimal ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); diff --git a/backend/tests/test_library.c b/backend/tests/test_library.c index 11540ffd..689607db 100644 --- a/backend/tests/test_library.c +++ b/backend/tests/test_library.c @@ -191,10 +191,10 @@ static void test_checks(const testCtx *const p_ctx) { /*127*/ { 150, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 }, /*128*/ { BARCODE_LAST + 1, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 206: Symbology out of range", BARCODE_CODE128 }, /*129*/ { BARCODE_LAST + 1, -1, "1", -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 206: Symbology out of range", -1 }, - /*130*/ { BARCODE_CODE128, -1, "\200", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input", -1 }, - /*131*/ { BARCODE_CODE128, -1, "\\o200", -1, UNICODE_MODE | ESCAPE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input", -1 }, - /*132*/ { BARCODE_MAXICODE, -1, "\200", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input", -1 }, - /*133*/ { BARCODE_MAXICODE, -1, "\\o200", -1, UNICODE_MODE | ESCAPE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input", -1 }, + /*130*/ { BARCODE_CODE128, -1, "\200", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 215: Invalid UTF-8 in input", -1 }, + /*131*/ { BARCODE_CODE128, -1, "\\o200", -1, UNICODE_MODE | ESCAPE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 215: Invalid UTF-8 in input", -1 }, + /*132*/ { BARCODE_MAXICODE, -1, "\200", -1, UNICODE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 215: Invalid UTF-8 in input", -1 }, + /*133*/ { BARCODE_MAXICODE, -1, "\\o200", -1, UNICODE_MODE | ESCAPE_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 215: Invalid UTF-8 in input", -1 }, /*134*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, -1, ZINT_WARN_NONCOMPLIANT, "Warning 261: AI (01) data position 14: Bad checksum '4', expected '1'", -1 }, /*135*/ { BARCODE_GS1_128, -1, "[01]12345678901234", -1, GS1_MODE, -1, 0, 0, 0, 0, -1, -1, 0, -1, WARN_FAIL_ALL, ZINT_ERROR_NONCOMPLIANT, "Error 261: AI (01) data position 14: Bad checksum '4', expected '1'", -1 }, /*136*/ { BARCODE_QRCODE, -1, "àž", -1, UNICODE_MODE, 13, 0, 0, 0, 0, -1, -1, 0, -1, -1, 0, "", -1 }, @@ -306,10 +306,10 @@ static void test_checks_segs(const testCtx *const p_ctx) { /* 8*/ { BARCODE_CODE128, -1, { { TU("A"), 0, 3 }, { NULL, 0, 0 } }, 1, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 217: Symbology does not support ECI switching" }, /* 9*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("B"), 0, 1 } }, 2, -1, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 218: ECI code '1' out of range (0 to 999999, excluding 1, 2, 14 and 19)" }, /* 10*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("B"), 0, 4 } }, 2, GS1_MODE, -1, -1, ZINT_ERROR_INVALID_OPTION, "Error 776: GS1 mode not supported for multiple segments" }, - /* 11*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("\200"), 0, 4 } }, 2, UNICODE_MODE, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8 in input" }, + /* 11*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("\200"), 0, 4 } }, 2, UNICODE_MODE, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 215: Invalid UTF-8 in input" }, /* 12*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 3 }, { TU("B"), 0, 4 } }, 2, -1, -1, -1, 0, "" }, /* 13*/ { BARCODE_AZTEC, -1, { { TU("A"), 0, 0 }, { TU("B"), 0, 4 } }, 2, -1, 3, -1, 0, "" }, - /* 14*/ { BARCODE_AZTEC, -1, { { TU("A"), ZINT_MAX_DATA_LEN, 3 }, { TU("B"), 1, 4 } }, 2, -1, -1, -1, ZINT_ERROR_TOO_LONG, "Error 243: Input too long" }, + /* 14*/ { BARCODE_AZTEC, -1, { { TU("A"), ZINT_MAX_DATA_LEN, 3 }, { TU("B"), 1, 4 } }, 2, -1, -1, -1, ZINT_ERROR_TOO_LONG, "Error 214: Input too long" }, }; const int data_size = ARRAY_SIZE(data); int i, ret; @@ -731,9 +731,9 @@ static void test_escape_char_process(const testCtx *const p_ctx) { /* 44*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\uFG", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input", 0, "" }, /* 45*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u00F", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\u' escape sequence in input", 0, "" }, /* 46*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\u00FG", "", ZINT_ERROR_INVALID_DATA, 0, "Error 211: Invalid character for '\\u' escape sequence in input (hexadecimal only)", 0, "" }, - /* 47*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\ufffe", "", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Value of escape sequence '\\ufffe' in input out of range", 0, "Reversed BOM" }, - /* 48*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\ud800", "", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Value of escape sequence '\\ud800' in input out of range", 0, "Surrogate" }, - /* 49*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\udfff", "", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Value of escape sequence '\\udfff' in input out of range", 0, "Surrogate" }, + /* 47*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\ufffe", "", ZINT_ERROR_INVALID_DATA, 0, "Error 216: Value of escape sequence '\\ufffe' in input out of range", 0, "Reversed BOM" }, + /* 48*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\ud800", "", ZINT_ERROR_INVALID_DATA, 0, "Error 216: Value of escape sequence '\\ud800' in input out of range", 0, "Surrogate" }, + /* 49*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\udfff", "", ZINT_ERROR_INVALID_DATA, 0, "Error 216: Value of escape sequence '\\udfff' in input out of range", 0, "Surrogate" }, /* 50*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\uffff", "", 0, 12, "E7 2C B0 16 AB A1 1F 85 EB 50 A1 4C", 0, "" }, /* 51*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, "\\xE2\\x82\\xAC", "", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 0, "Zint manual 4.10 Ex1" }, /* 52*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, "\\u20AC", "", 0, 12, "F1 12 EB 25 81 4A 0A 8C 31 AC E3 2E", 1, "" }, @@ -755,7 +755,7 @@ static void test_escape_char_process(const testCtx *const p_ctx) { /* 68*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\Udfff", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input", 0, "Surrogate" }, /* 69*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U000F", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input", 0, "" }, /* 70*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U0000F", "", ZINT_ERROR_INVALID_DATA, 0, "Error 209: Incomplete '\\U' escape sequence in input", 0, "" }, - /* 71*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U110000", "", ZINT_ERROR_INVALID_DATA, 0, "Error 246: Value of escape sequence '\\U110000' in input out of range", 0, "" }, + /* 71*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\U110000", "", ZINT_ERROR_INVALID_DATA, 0, "Error 216: Value of escape sequence '\\U110000' in input out of range", 0, "" }, /* 72*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 25, "\\U10FFFF", "", 0, 14, "F1 1A E7 57 C7 81 F7 AC 09 06 28 51 F3 00 E1 8C 2A 1C", 0, "" }, /* 73*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, "\\U10FFFF", "", 0, 14, "F1 1B E7 57 E0 11 D7 6C 4F 45 E2 B3 FF F1 72 AB 54 9F", 0, "" }, /* 74*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, "\\U10FFFF", "", 0, 14, "F1 21 EB 64 33 EB 1B 36 1D F7 B1 6D 8C A6 34 64 19 3A", 0, "" }, @@ -764,11 +764,25 @@ static void test_escape_char_process(const testCtx *const p_ctx) { /* 77*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, "\\U10FFFF", "", 0, 14, "F1 24 EB 80 EB 80 11 01 17 BA C6 05 9F 4C EA E5 18 31", 0, "" }, /* 78*/ { BARCODE_GS1_128_CC, GS1_MODE, -1, "[20]10", "[10]A", 0, 99, "(7) 105 102 20 10 100 59 106", 0, "" }, /* 79*/ { BARCODE_GS1_128_CC, GS1_MODE, -1, "[2\\x30]1\\d048", "[\\x310]\\x41", 0, 99, "(7) 105 102 20 10 100 59 106", 1, "" }, - /* 80*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\^A1", "", ZINT_ERROR_INVALID_DATA, 0, "Error 798: Escape '\\^' only valid for Code 128 in extra escape mode", 0, "" }, - /* 81*/ { BARCODE_CODE128, DATA_MODE | EXTRA_ESCAPE_MODE, -1, "\\^A1", "", 0, 46, "(4) 103 17 17 106", 0, "" }, - /* 82*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, "\\^", "", 0, 57, "(5) 104 60 62 82 106", 0, "Partial special escape '\\^' at end allowed" }, - /* 83*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, "\\^D1", "", 0, 79, "(7) 104 60 62 36 17 52 106", 0, "Unknown special escapes passed straight thu" }, - /* 84*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\w", "", ZINT_ERROR_INVALID_DATA, 0, "Error 234: Unrecognised escape character '\\w' in input", 0, "" }, + /* 80*/ { BARCODE_AZTEC, DATA_MODE, -1, "\\^11", "", ZINT_ERROR_INVALID_DATA, 0, "Error 798: Escape '\\^' only valid in extra escape mode", 0, "" }, + /* 81*/ { BARCODE_AZTEC, DATA_MODE | EXTRA_ESCAPE_MODE, -1, "\\^11", "", ZINT_ERROR_INVALID_DATA, 0, "Error 213: Extra escape '\\^' not valid for this symbology and/or input mode", 0, "" }, + /* 82*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\^11", "", ZINT_ERROR_INVALID_DATA, 0, "Error 798: Escape '\\^' only valid in extra escape mode", 0, "" }, + /* 83*/ { BARCODE_DATAMATRIX, GS1_MODE, -1, "\\^11", "", ZINT_ERROR_INVALID_DATA, 0, "Error 798: Escape '\\^' only valid in extra escape mode", 0, "" }, + /* 84*/ { BARCODE_DATAMATRIX, DATA_MODE | EXTRA_ESCAPE_MODE, -1, "\\^11", "", 0, 10, "E8 32 81 98 94 7B 7F 6D", 0, "" }, + /* 85*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, -1, "\\^A1", "", ZINT_ERROR_INVALID_DATA, 0, "Error 717: Unrecognized extra escape \"\\^A\"", 0, "" }, + /* 86*/ { BARCODE_DATAMATRIX, GS1_MODE | EXTRA_ESCAPE_MODE, -1, "\\^11", "", ZINT_ERROR_INVALID_DATA, 0, "Error 213: Extra escape '\\^' not valid for this symbology and/or input mode", 0, "Not allowed of DATAMATRIX in GS1_MODE" }, + /* 87*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 18, "A\\^1B", "", 0, 12, "F1 13 42 E8 43 C3 1B 02 5A 6B 37 CC", 0, "" }, + /* 88*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 20, "A\\^1B", "", ZINT_ERROR_INVALID_OPTION, 0, "Error 716: Extra escape mode requires ASCII-compatible ECI", 0, "" }, + /* 89*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 20, "バ\\^1ăƒŒă‚ł\\^1ăƒŒăƒ‰\\^1東äșŹ\\^1郜", "", ZINT_ERROR_INVALID_OPTION, 0, "Error 716: Extra escape mode requires ASCII-compatible ECI", 0, "" }, + /* 90*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 25, "A\\^1B", "", ZINT_ERROR_INVALID_OPTION, 0, "Error 716: Extra escape mode requires ASCII-compatible ECI", 0, "" }, + /* 91*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 33, "A\\^1B", "", ZINT_ERROR_INVALID_OPTION, 0, "Error 716: Extra escape mode requires ASCII-compatible ECI", 0, "" }, + /* 92*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 170, "A\\^1B", "", ZINT_ERROR_INVALID_DATA, 0, "Error 244: Invalid character in input for ECI '170'", 0, "" }, + /* 93*/ { BARCODE_DATAMATRIX, UNICODE_MODE | EXTRA_ESCAPE_MODE, 899, "A\\^1B", "", ZINT_ERROR_INVALID_OPTION, 0, "Error 716: Extra escape mode requires ASCII-compatible ECI", 0, "" }, + /* 94*/ { BARCODE_CODE128, DATA_MODE, -1, "\\^A1", "", ZINT_ERROR_INVALID_DATA, 0, "Error 798: Escape '\\^' only valid in extra escape mode", 0, "" }, + /* 95*/ { BARCODE_CODE128, DATA_MODE | EXTRA_ESCAPE_MODE, -1, "\\^A1", "", 0, 46, "(4) 103 17 17 106", 0, "" }, + /* 96*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, "\\^", "", 0, 57, "(5) 104 60 62 82 106", 0, "Partial special escape '\\^' at end allowed" }, + /* 97*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, -1, "\\^D1", "", ZINT_ERROR_INVALID_DATA, 0, "Error 348: Unrecognized extra escape \"\\^D\"", 0, "" }, + /* 98*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\w", "", ZINT_ERROR_INVALID_DATA, 0, "Error 234: Unrecognised escape character '\\w' in input", 0, "" }, }; const int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -891,6 +905,7 @@ static void test_escape_char_process_test(const testCtx *const p_ctx) { /* 2*/ { 0, 0, "\\U010283", 0, "\360\220\212\203", 4 }, /* 3*/ { 0, 0, "\\u007F\\u0080\\u011E\\u13C9\\U010283", 0, "\177\302\200\304\236\341\217\211\360\220\212\203", 12 }, /* 4*/ { BARCODE_CODE128, EXTRA_ESCAPE_MODE, "\\^A\\^^\\^B", 0, "\\^A\\^^\\^B", 9 }, + /* 5*/ { BARCODE_DATAMATRIX, EXTRA_ESCAPE_MODE, "\\^1\\^^\\^1", 0, "\\^1\\^^\\^1", 9 }, }; const int data_size = ARRAY_SIZE(data); int i, length, ret; diff --git a/backend/tests/testcommon.c b/backend/tests/testcommon.c index 5ca19e09..f1271a2d 100644 --- a/backend/tests/testcommon.c +++ b/backend/tests/testcommon.c @@ -2665,29 +2665,77 @@ static char *testUtilBwippCvtGS1Data(char *bwipp_data, const int bwipp_data_size return bwipp_data; } +/* Copied from "library.c" */ +/* 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); +} + #define z_isxdigit(c) (z_isdigit(c) || ((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f')) #define z_isodigit(c) ((c) <= '7' && (c) >= '0') /* Convert data to Ghostscript format for passing to bwipp_dump.ps */ -static char *testUtilBwippEscape(char *bwipp_data, const int bwipp_data_size, const char *data, const int length, - const int zint_escape_mode, const int eci, int *parse, int *parsefnc) { +static char *testUtilBwippEscape(const struct zint_symbol *const symbol, char *bwipp_data, const int bwipp_data_size, + const char *data, const int length, const int eci, int *parse, int *parsefnc) { + const int is_extra_escaped = (symbol->input_mode & EXTRA_ESCAPE_MODE) && supports_extra_escape_mode(symbol); + const int is_escaped = (symbol->input_mode & ESCAPE_MODE) || is_extra_escaped; + const int is_c128 = symbol->symbology == BARCODE_CODE128; char *b = bwipp_data; char *be = b + bwipp_data_size; unsigned char *d = (unsigned char *) data; unsigned char *de = (unsigned char *) data + length; int have_done_single_caret = 0; /* Flag to help debug escaping of carets */ - if (eci && !*parsefnc) { + if (eci) { sprintf(bwipp_data, "^ECI%06d", eci); *parsefnc = 1; b = bwipp_data + 10; } while (b < be && d < de) { + /* Deal with extra escape sequences first */ + if (is_extra_escaped && *d == '\\' && d + 1 < de && d[1] == '^' + && (d + 2 == de || ((d[2] == '1' || d[2] == '^' || (is_c128 && d[2] >= '@' && d[2] <= 'C'))))) { + if (d + 2 == de || d[2] == '^') { + /* Literal "\^^" */ + if (*parsefnc) { + if (b + 6 >= be) { + fprintf(stderr, "testUtilBwippEscape: extra escape double caret bwipp_data buffer full (%d)\n", + bwipp_data_size); + return NULL; + } + strcpy(b, "^092^^"); + b += 6; + *parse = 1; + } else { + if (b + 8 >= be) { + fprintf(stderr, "testUtilBwippEscape: extra escape 094 caret bwipp_data buffer full (%d)\n", + bwipp_data_size); + return NULL; + } + strcpy(b, "^092^094"); + b += 8; + *parse = 1; + } + } else if (d[2] == '1') { + if (b + 5 >= be) { + fprintf(stderr, "testUtilBwippEscape: extra escape FNC1 bwipp_data buffer full (%d)\n", + bwipp_data_size); + return NULL; + } + strcpy(b, "^FNC1"); + b += 5; + *parsefnc = 1; + } else { + assert(d + 2 < de && is_c128 && d[2] >= '@' && d[2] <= 'C'); + } + d += 2 + (d + 2 != de); + /* Have to escape double quote otherwise Ghostscript gives "Unterminated quote in @-file" for some reason */ /* Escape single quote also to avoid having to do proper shell escaping TODO: proper shell escaping */ - if (*d < 0x20 || *d >= 0x7F || (*d == '^' && !*parsefnc) || *d == '"' || *d == '\'' - || *d == '(' || (*d == '\\' && !zint_escape_mode)) { + } else if (*d < 0x20 || *d >= 0x7F || (*d == '^' && !*parsefnc) || *d == '"' || *d == '\'' + || *d == '(' || (*d == '\\' && !is_escaped)) { if (b + 4 >= be) { fprintf(stderr, "testUtilBwippEscape: double quote bwipp_data buffer full (%d)\n", bwipp_data_size); return NULL; @@ -2710,7 +2758,7 @@ static char *testUtilBwippEscape(char *bwipp_data, const int bwipp_data_size, co /* `parsefnc` changed while escaping (see FNC1 processing below) - may cause test to fail */ fprintf(stderr, "testUtilBwippEscape: WARNING: already escaped caret singularly\n"); } - } else if (zint_escape_mode && *d == '\\' && d + 1 < de) { + } else if (is_escaped && *d == '\\' && d + 1 < de) { int val; switch (*++d) { case '0': val = 0x00; /* Null */ break; @@ -2883,6 +2931,7 @@ static char *testUtilBwippUtf8Convert(const int index, const int symbology, cons /* Create bwipp_dump.ps command and run */ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int option_2, int option_3, const char *data, int length, const char *primary, char *buffer, int buffer_size, int *p_parsefnc) { + static const char fn[] = "testUtilBwipp"; static const char cmd_fmt[] = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%s'" " backend/tests/tools/bwipp_dump.ps"; static const char cmd_opts_fmt[] = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%s' -so='%s'" @@ -2924,10 +2973,11 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int FILE *fp = NULL; int cnt; + int exit_status; char *b = buffer; char *be = buffer + buffer_size; - int r, h; + int r; int parse = 0, parsefnc = p_parsefnc ? *p_parsefnc : 0; const int upcean = (ZBarcode_Cap(symbology, ZINT_CAP_EANUPC) & ZINT_CAP_EANUPC) == ZINT_CAP_EANUPC; @@ -2944,8 +2994,8 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int bwipp_barcode = testUtilBwippName(index, symbol, option_1, option_2, option_3, 0, &linear_row_height, &gs1_cvt); if (!bwipp_barcode) { - fprintf(stderr, "i:%d testUtilBwipp: no mapping for %s, option_1 %d, option_2 %d, option_3 %d\n", - index, testUtilBarcodeName(symbology), option_1, option_2, option_3); + fprintf(stderr, "i:%d %s:%d no mapping for %s, option_1 %d, option_2 %d, option_3 %d\n", + index, fn, __LINE__, testUtilBarcodeName(symbology), option_1, option_2, option_3); return -1; } @@ -2956,8 +3006,8 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int bwipp_row_height[r] = symbol->row_height[r] ? symbol->row_height[r] : linear_row_height; } if ((symbol->debug & ZINT_DEBUG_TEST_PRINT) && !(symbol->debug & ZINT_DEBUG_TEST_LESS_NOISY)) { - fprintf(stderr, "bwipp_row_height[%d] %d, symbol->row_height[%d] %g\n", - r, bwipp_row_height[r], r, symbol->row_height[r]); + fprintf(stderr, "i:%d %s:%d bwipp_row_height[%d] %d, symbol->row_height[%d] %g\n", + index, fn, __LINE__, r, bwipp_row_height[r], r, symbol->row_height[r]); } } @@ -2966,14 +3016,15 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int if ((symbol->input_mode & 0x07) == UNICODE_MODE && zint_is_eci_convertible(eci) && (data = testUtilBwippUtf8Convert(index, symbology, 1 /*try_sjis*/, &eci, (const unsigned char *) data, &data_len, (unsigned char *) converted)) == NULL) { - fprintf(stderr, "i:%d testUtilBwipp: failed to convert UTF-8 data for %s\n", - index, testUtilBarcodeName(symbology)); + fprintf(stderr, "i:%d %s:%d failed to convert UTF-8 data for %s\n", + index, fn, __LINE__, testUtilBarcodeName(symbology)); return -1; } if (z_is_composite(symbology)) { if (!primary) { - fprintf(stderr, "i:%d testUtilBwipp: no primary data given %s\n", index, testUtilBarcodeName(symbology)); + fprintf(stderr, "i:%d %s:%d no primary data given %s\n", + index, fn, __LINE__, testUtilBarcodeName(symbology)); return -1; } if (*primary != obracket && !upcean) { @@ -3072,10 +3123,7 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int } #endif } else { - const int is_extra_escaped = (symbol->input_mode & EXTRA_ESCAPE_MODE) - && symbol->symbology == BARCODE_CODE128; - const int is_escaped = (symbol->input_mode & ESCAPE_MODE) || is_extra_escaped; - if (testUtilBwippEscape(bwipp_data, bwipp_data_size, data, data_len, is_escaped, eci, &parse, &parsefnc) + if (testUtilBwippEscape(symbol, bwipp_data, bwipp_data_size, data, data_len, eci, &parse, &parsefnc) == NULL) { return -1; } @@ -3560,9 +3608,8 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int } if ((option_1 != -1 || option_2 != -1 || option_3 != -1) && !bwipp_opts) { - fprintf(stderr, - "i:%d testUtilBwipp: no BWIPP options set option_1 %d, option_2 %d, option_3 %d for symbology %s\n", - index, option_1, option_2, option_3, testUtilBarcodeName(symbology)); + fprintf(stderr, "i:%d %s:%d no BWIPP options set option_1 %d, option_2 %d, option_3 %d for symbology %s\n", + index, fn, __LINE__, option_1, option_2, option_3, testUtilBarcodeName(symbology)); return -1; } @@ -3607,7 +3654,7 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int memcpy(cmd + GS_INITIAL_LEN, adj, sizeof(adj) - 1); } if (symbology == BARCODE_CODE11 || symbology == BARCODE_CODE39 || symbology == BARCODE_EXCODE39 - || symbology == BARCODE_CODABAR || symbology == BARCODE_PHARMA || symbology == BARCODE_PZN + || symbology == BARCODE_CODABAR || symbology == BARCODE_PZN || symbology == BARCODE_CODE32 || symbology == BARCODE_VIN) { /* Ratio 3 width bar/space -> 2 width */ char adj[] = " -sr=0.6"; @@ -3664,12 +3711,12 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int } if (symbol->debug & ZINT_DEBUG_TEST_PRINT) { - printf("i:%d testUtilBwipp: cmd %s\n", index, cmd); + printf("i:%d %s cmd %s\n", index, fn, cmd); } fp = testutil_popen(cmd, "r"); if (!fp) { - fprintf(stderr, "i:%d testUtilBwipp: failed to run '%s'\n", index, cmd); + fprintf(stderr, "i:%d %s:%d failed to run '%s'\n", index, fn, __LINE__, cmd); return -1; } @@ -3679,45 +3726,38 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int } else { for (r = 0; r < symbol->rows; r++) { if (b + symbol->width > be) { - fprintf(stderr, "i:%d testUtilBwipp: row %d, width %d, row width iteration overrun (%s)\n", - index, r, symbol->width, cmd); - testutil_pclose(fp); + fprintf(stderr, "i:%d %s:%d row %d, width %d, row width iteration overrun (%s)\n", + index, fn, __LINE__, r, symbol->width, cmd); + (void) testutil_pclose(fp); return -1; } cnt = (int) fread(b, 1, symbol->width, fp); if (cnt != symbol->width) { - fprintf(stderr, - "i:%d testUtilBwipp: failed to read row %d of %d, symbol->width %d bytes, cnt %d (%s)\n", - index, r + 1, symbol->rows, symbol->width, cnt, cmd); - testutil_pclose(fp); + fprintf(stderr, "i:%d %s:%d failed to read row %d of %d, symbol->width %d bytes, cnt %d (%s)\n", + index, fn, __LINE__, r + 1, symbol->rows, symbol->width, cnt, cmd); + (void) testutil_pclose(fp); return -1; } b += cnt; - for (h = bwipp_row_height[r]; h > 1; h--) { /* Ignore row copies if any */ - cnt = (int) fread(b, 1, symbol->width, fp); - if (cnt != symbol->width) { - fprintf(stderr, - "i:%d testUtilBwipp: failed to read/ignore symbol->width %d bytes, cnt %d, h %d" - ", bwipp_row_height[%d] %d, symbol->row_height[%d] %g (%s)\n", - index, symbol->width, cnt, h, r, bwipp_row_height[r], r, symbol->row_height[r], cmd); - testutil_pclose(fp); - return -1; - } - if (h * 2 == bwipp_row_height[r]) { /* Hack to use middle row (avoids add-on text offsets) */ - memcpy(b - cnt, b, cnt); - } - } } } *b = '\0'; if (fgetc(fp) != EOF) { - fprintf(stderr, "i:%d testUtilBwipp: failed to read full stream (%s)\n", index, cmd); - testutil_pclose(fp); + fprintf(stderr, "i:%d %s:%d failed to read full stream (%s)\n", index, fn, __LINE__, cmd); + (void) testutil_pclose(fp); return -1; } - testutil_pclose(fp); + if ((exit_status = testutil_pclose(fp))) { +#ifndef _WIN32 + if (WIFEXITED(exit_status)) { + exit_status = WEXITSTATUS(exit_status); + } +#endif + fprintf(stderr, "i:%d %s:%d pclose returned exit status %d (%s)\n", index, fn, __LINE__, exit_status, cmd); + return -1; + } return 0; } @@ -3797,7 +3837,7 @@ int testUtilBwippSegs(int index, struct zint_symbol *symbol, int option_1, int o total_len = (int) (d - data); if (unicode_mode) { - symbol->input_mode = DATA_MODE; + symbol->input_mode = DATA_MODE | (symbol->input_mode & ~0x07); } symbol->eci = 0; @@ -4147,6 +4187,7 @@ int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, FILE *fp = NULL; int cnt; + int exit_status; buffer[0] = '\0'; @@ -4192,17 +4233,25 @@ int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, if (cnt == buffer_size) { fprintf(stderr, "i:%d testUtilZXingCPP: buffer too small, %d bytes, cnt %d (%s)\n", index, buffer_size, cnt, cmd); - testutil_pclose(fp); + (void) testutil_pclose(fp); return -1; } if (fgetc(fp) != EOF) { fprintf(stderr, "i:%d testUtilZXingCPP: failed to read full stream (%s)\n", index, cmd); - testutil_pclose(fp); + (void) testutil_pclose(fp); return -1; } - testutil_pclose(fp); + if ((exit_status = testutil_pclose(fp))) { +#ifndef _WIN32 + if (WIFEXITED(exit_status)) { + exit_status = WEXITSTATUS(exit_status); + } +#endif + fprintf(stderr, "i:%d testUtilZXingCPP: pclose returned exit status %d (%s)\n", index, exit_status, cmd); + return -1; + } if ((data_mode && zxingcpp_cmp > 1 && (zxingcpp_cmp == 899 || zint_is_eci_convertible(zxingcpp_cmp))) || symbol->eci >= 899) { @@ -4311,7 +4360,7 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in const int is_dbar_nonexp = symbology == BARCODE_DBAR_OMN || symbology == BARCODE_DBAR_LTD || symbology == BARCODE_DBAR_OMNSTK || symbology == BARCODE_DBAR_STK; const int gs1 = (symbol->input_mode & 0x07) == GS1_MODE || is_gs1_128_dbar_exp; - const int is_extra_escaped = (symbol->input_mode & EXTRA_ESCAPE_MODE) && symbol->symbology == BARCODE_CODE128; + const int is_extra_escaped = (symbol->input_mode & EXTRA_ESCAPE_MODE) && supports_extra_escape_mode(symbol); const int is_escaped = (symbol->input_mode & ESCAPE_MODE) || is_extra_escaped; const int is_hibc = symbology >= BARCODE_HIBC_128 && symbology <= BARCODE_HIBC_AZTEC; const int have_ccheckdigit = symbol->option_2 == 1 || symbol->option_2 == 2; /* Good for C25, CODE39, CODABAR */ @@ -4360,6 +4409,7 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in /* Remove any Code 128 special escapes */ int j = 0; int have_manual_ab = 0; + int have_position_fnc1 = 0; for (i = 0; i < expected_len; i++) { if (escaped[i] == '\\' && i + 2 < expected_len && escaped[i + 1] == '^' && ((escaped[i + 2] >= '@' && escaped[i + 2] <= 'C') || escaped[i + 2] == '1' @@ -4372,11 +4422,13 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in /* FNC1 in 1st position treated as GS1 and in 2nd position AIM, neither transmitted - need to skip AIM (single alphabetic or Code Set C double digit) TODO: guessing about whether in Code Set C for double digit */ - if (j > 2 || (j == 1 && !(z_isupper(escaped[0]) || z_islower(escaped[0]))) + if (symbol->eci || have_position_fnc1 || j > 2 || (j == 1 && !z_isalpha(escaped[0])) || (j == 2 && !(z_isdigit(escaped[0]) && z_isdigit(escaped[1]) && !have_manual_ab))) { /* Probably not AIM */ escaped[j++] = 29; /* GS */ + } else { + have_position_fnc1 = 1; } } } else { diff --git a/backend/tests/tools/bwipp_dump-barcode.ps.cat b/backend/tests/tools/bwipp_dump-barcode.ps.cat index 360f6121..c0a72a5b 100644 --- a/backend/tests/tools/bwipp_dump-barcode.ps.cat +++ b/backend/tests/tools/bwipp_dump-barcode.ps.cat @@ -98,6 +98,32 @@ ret /pixs known { pixs 0 tmppixs 0 j getinterval putinterval } if + b (databarlimitedcomposite) eq { + % Add RHS 5-space quiet zone + /cpypixs pixs length array def + cpypixs 0 pixs 0 pixs length getinterval putinterval + /pixw pixs length pixx idiv def + /pixs [ + 0 pixx cpypixs length 1 sub { + /i exch def + cpypixs i pixx getinterval aload pop 0 0 0 0 0 + } for + ] def + /pixx pixx 5 add def + } if + + b (ean13composite) eq b (ean8composite) eq or b (upcacomposite) eq or b (upcecomposite) eq or { + d (|) search { + /linear exch def + pop pop + linear ( ) search { % Have add-on? + pop pop pop + % Remove last row from pixs array which just contains add-on overhang + /pixs [ pixs 0 pixs length pixx sub getinterval aload pop ] def + } { pop } ifelse + } { pop } ifelse + } if + /xs systemdict /xs known { systemdict /xs get cvi } { 0 } ifelse def /xe systemdict /xe known { systemdict /xe get cvi } { 0 } ifelse def diff --git a/backend/tests/tools/bwipp_dump.ps.tar.xz b/backend/tests/tools/bwipp_dump.ps.tar.xz index b6821a7d..db4d64c2 100644 Binary files a/backend/tests/tools/bwipp_dump.ps.tar.xz and b/backend/tests/tools/bwipp_dump.ps.tar.xz differ diff --git a/backend/zint.h b/backend/zint.h index 936ae4a6..1173e7eb 100644 --- a/backend/zint.h +++ b/backend/zint.h @@ -324,7 +324,7 @@ extern "C" { #define FAST_MODE 0x0080 /* Use faster if less optimal encodation or other shortcuts if available */ /* (affects AZTEC, DATAMATRIX, MICROPDF417, PDF417, QRCODE & UPNQR only) */ #define EXTRA_ESCAPE_MODE 0x0100 /* Process special symbology-specific escape sequences as well as others */ - /* Note: currently Code 128 only */ + /* Note: currently Code 128 and Data Matrix only */ #define GS1SYNTAXENGINE_MODE 0x0200 /* Use the GS1 Syntax Engine (if available) to strictly validate GS1 input */ #define GS1RAW_MODE 0x0400 /* Process GS1 data literally (no AI delimiters), parsing GSs as FNC1s */ diff --git a/backend_tcl/zint.c b/backend_tcl/zint.c index 6421f2b8..f0380ef4 100644 --- a/backend_tcl/zint.c +++ b/backend_tcl/zint.c @@ -577,7 +577,7 @@ static const char help_message[] = "zint tcl(stub,obj) dll\n" " -eci choice: ECI to use\n" /* cli option --embedfont not supported (vector output only) */ " -esc bool: process escape sequences in input data\n" - " -extraesc bool: process symbology-specific escape sequences (Code 128 only)\n" + " -extraesc bool: process symbology-specific escape sequences (Code 128 and Data Matrix only)\n" " -fast bool: use fast encodation (Aztec, Data Matrix, MicroPDF417, PDF417, QR, UPNQR)\n" " -fg color: set foreground color as 6 or 8 hex rrggbbaa\n" /* replaces cli options --binary and --gs1 */ diff --git a/docs/manual.html b/docs/manual.html index 26283968..fe93be60 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -334,7 +334,7 @@

Zint Barcode Generator and Zint Barcode Studio User Manual

Version 2.16.0.9

-

March 2026

+

April 2026