diff --git a/ChangeLog b/ChangeLog index c39f548d..2b77bd8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,10 @@ Version 2.10.0.9 (dev) not released yet - Matrix symbols: horizontal boundary bars appear outside any vertical whitespace NOTE: previously appeared inside vertical whitespace +- ECI 29 now GB 2312 only; GB 18030 is new ECI 32 + NOTE: previously ECI 29 was GB 18030 for HANXIN, GB 2312 otherwise +- GRIDMATRIX, HANXIN, QRCODE/RMQR now warn when convert to GB 2312, GB 18030, + Shift JIS resp. and no ECI given Changes ------- @@ -53,6 +57,10 @@ Changes - Matrix symbols: change horizontal boundary bars to appear outside any vertical whitespace, as they're decorative rather than functional (#247) - FIM: Add support for FIM E +- Updated ECIs to AIM ITS/04-023:2022 (ECI Part 3: Register) +- HANXIN: removed alternating filler in function information +- GRIDMATRIX/HANXIN/QRCODE/RMQR: warn if auto-conversion (i.e. no ECI given) + occurs to resp. specialized char sets (GB 2312/GB 18030/Shift JIS) Bugs ---- @@ -76,6 +84,7 @@ Bugs props Alex Geller - DATAMATRIX: fix mis-encoding of FNC1/GS in EDIFACT in GS1 mode - Allow for dot overspill in height of vertical box sides (dotty mode) +- HANXIN: fix gate-posts on codeword limits Version 2.10.0 2021-08-14 diff --git a/backend/eci.c b/backend/eci.c index 5fd89f63..eb9b434b 100644 --- a/backend/eci.c +++ b/backend/eci.c @@ -1,7 +1,7 @@ /* eci.c - Extended Channel Interpretations libzint - the open source barcode library - Copyright (C) 2009 - 2021 Robin Stuart + Copyright (C) 2009-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -28,7 +28,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #ifdef _MSC_VER #include @@ -40,6 +39,7 @@ #include "big5.h" #include "gb2312.h" #include "ksx1001.h" +#include "gb18030.h" /* ECI 20 Shift JIS */ static int sjis_wctomb(unsigned char *r, const unsigned int wc) { @@ -126,6 +126,47 @@ static int euc_kr_wctomb(unsigned char *r, const unsigned int wc) { return 0; } +/* ECI 31 GBK Chinese */ +static int gbk_wctomb(unsigned char *r, const unsigned int wc) { + unsigned int c; + + if (wc < 0x80) { + *r = (unsigned char) wc; + return 1; + } + if (gbk_wctomb_zint(&c, wc)) { + r[0] = (unsigned char) (c >> 8); + r[1] = (unsigned char) (c & 0xff); + return 2; + } + return 0; +} + +/* ECI 32 GB 18030 Chinese */ +static int gb18030_wctomb(unsigned char *r, const unsigned int wc) { + unsigned int c1, c2; + int ret; + + if (wc < 0x80) { + *r = (unsigned char) wc; + return 1; + } + ret = gb18030_wctomb_zint(&c1, &c2, wc); + if (ret == 2) { + r[0] = (unsigned char) (c1 >> 8); + r[1] = (unsigned char) (c1 & 0xff); + return 2; + } + if (ret == 4) { + r[0] = (unsigned char) (c1 >> 8); + r[1] = (unsigned char) (c1 & 0xff); + r[2] = (unsigned char) (c2 >> 8); + r[3] = (unsigned char) (c2 & 0xff); + return 4; + } + return 0; +} + /* Helper to count the number of chars in a string within a range */ static int chr_range_cnt(const unsigned char string[], const int length, const unsigned char c1, const unsigned char c2) { @@ -149,8 +190,8 @@ static int chr_range_cnt(const unsigned char string[], const int length, const u /* Is ECI convertible from UTF-8? */ INTERNAL int is_eci_convertible(const int eci) { - if (eci == 26 || (eci > 30 && eci != 170)) { /* Exclude ECI 170 - ASCII Invariant */ - /* UTF-8 (26) or 8-bit binary data (899) or undefined (> 30 and < 899) or not character set (> 899) */ + if (eci == 26 || (eci > 35 && eci != 170)) { /* Exclude ECI 170 - ASCII Invariant */ + /* UTF-8 (26) or 8-bit binary data (899) or undefined (> 35 and < 899) or not character set (> 899) */ return 0; } return 1; @@ -162,16 +203,21 @@ INTERNAL int get_eci_length(const int eci, const unsigned char source[], int len /* Only ASCII backslash (reverse solidus) exceeds UTF-8 length */ length += chr_cnt(source, length, '\\'); - } else if (eci == 25) { /* UCS-2BE */ + } else if (eci == 25 || eci == 33) { /* UTF-16 */ /* All ASCII chars take 2 bytes */ length += chr_range_cnt(source, length, 0, 0x7F); + /* Surrogate pairs are 4 UTF-8 bytes long so fit */ - } else if (eci == 29) { /* GB 2312 (and GB 18030 if Han Xin) */ - /* Not needed for GB 2312 but allow for GB 18030 4 byters */ + } else if (eci == 32) { /* GB 18030 */ + /* Allow for GB 18030 4 byters */ length *= 2; + + } else if (eci == 34 || eci == 35) { /* UTF-32 */ + /* Quadruple-up ASCII and double-up non-ASCII */ + length += chr_range_cnt(source, length, 0, 0x7F) * 2 + length; } - /* Big5 and EUC-KR fit in UTF-8 length */ + /* Big5, GB 2312, EUC-KR and GBK fit in UTF-8 length */ return length; } @@ -180,14 +226,15 @@ INTERNAL int get_eci_length(const int eci, const unsigned char source[], int len INTERNAL int utf8_to_eci(const int eci, const unsigned char source[], unsigned char dest[], int *p_length) { typedef int (*eci_func_t)(unsigned char *r, const unsigned int wc); - static const eci_func_t eci_funcs[31] = { - NULL, NULL, NULL, NULL, iso8859_2_wctosb, - iso8859_3_wctosb, iso8859_4_wctosb, iso8859_5_wctosb, iso8859_6_wctosb, iso8859_7_wctosb, - iso8859_8_wctosb, iso8859_9_wctosb, iso8859_10_wctosb, iso8859_11_wctosb, NULL, - iso8859_13_wctosb, iso8859_14_wctosb, iso8859_15_wctosb, iso8859_16_wctosb, NULL, - sjis_wctomb, cp1250_wctosb, cp1251_wctosb, cp1252_wctosb, cp1256_wctosb, - ucs2be_wctomb, NULL, ascii_wctosb, big5_wctomb, gb2312_wctomb, - euc_kr_wctomb, + static const eci_func_t eci_funcs[36] = { + NULL, NULL, NULL, NULL, iso8859_2_wctosb, /*0-4*/ + iso8859_3_wctosb, iso8859_4_wctosb, iso8859_5_wctosb, iso8859_6_wctosb, iso8859_7_wctosb, /*5-9*/ + iso8859_8_wctosb, iso8859_9_wctosb, iso8859_10_wctosb, iso8859_11_wctosb, NULL, /*10-14*/ + iso8859_13_wctosb, iso8859_14_wctosb, iso8859_15_wctosb, iso8859_16_wctosb, NULL, /*15-19*/ + sjis_wctomb, cp1250_wctosb, cp1251_wctosb, cp1252_wctosb, cp1256_wctosb, /*20-24*/ + utf16be_wctomb, NULL, ascii_wctosb, big5_wctomb, gb2312_wctomb, /*25-29*/ + euc_kr_wctomb, gbk_wctomb, gb18030_wctomb, utf16le_wctomb, utf32be_wctomb, /*30-34*/ + utf32le_wctomb, }; eci_func_t eci_func; unsigned int codepoint, state; @@ -277,3 +324,5 @@ INTERNAL int get_best_eci(const unsigned char source[], int length) { return 26; // If all of these fail, use Unicode! } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/eci_sb.h b/backend/eci_sb.h index 00841cc4..bfe766f9 100644 --- a/backend/eci_sb.h +++ b/backend/eci_sb.h @@ -1,7 +1,7 @@ -/* eci_sb.h - Extended Channel Interpretations single-byte and UCS-2 BE +/* eci_sb.h - Extended Channel Interpretations single-byte and UTF-16/32 libzint - the open source barcode library - Copyright (C) 2021 Robin Stuart + Copyright (C) 2021-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -28,10 +28,9 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ -#ifndef ECI_SB_H -#define ECI_SB_H +#ifndef Z_ECI_SB_H +#define Z_ECI_SB_H /* * Adapted from GNU LIBICONV library */ @@ -1116,17 +1115,84 @@ static int cp1256_wctosb(unsigned char *r, const unsigned int wc) { } /* - * UCS-2 (libiconv-1.16/lib/ucs2.h) + * UTF-16BE (libiconv-1.16/lib/utf16be.h) */ -/* ECI 25 UC2-2 Big Endian (ISO/IEC 10646) */ -static int ucs2be_wctomb(unsigned char *r, const unsigned int wc) { - if (wc < 0x10000 && wc != 0xfffe && !(wc >= 0xd800 && wc < 0xe000)) { - r[0] = (unsigned char) (wc >> 8); - r[1] = (unsigned char) (wc & 0xff); - return 2; +/* ECI 25 UTF-16 Big Endian (ISO/IEC 10646) */ +static int utf16be_wctomb(unsigned char *r, const unsigned int wc) { + if (!(wc >= 0xd800 && wc < 0xe000)) { + if (wc < 0x10000) { + r[0] = (unsigned char) (wc >> 8); + r[1] = (unsigned char) (wc & 0xff); + return 2; + } else if (wc < 0x110000) { + unsigned int wc1 = 0xd800 + ((wc - 0x10000) >> 10); + unsigned int wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff); + r[0] = (unsigned char) (wc1 >> 8); + r[1] = (unsigned char) (wc1 & 0xff); + r[2] = (unsigned char) (wc2 >> 8); + r[3] = (unsigned char) (wc2 & 0xff); + return 4; + } } return 0; } -#endif /* ECI_SB_H */ +/* + * UTF-16LE (libiconv-1.16/lib/utf16le.h) + */ + +/* ECI 33 UTF-16 Little Endian (ISO/IEC 10646) */ +static int utf16le_wctomb(unsigned char *r, const unsigned int wc) { + if (!(wc >= 0xd800 && wc < 0xe000)) { + if (wc < 0x10000) { + r[0] = (unsigned char) (wc & 0xff); + r[1] = (unsigned char) (wc >> 8); + return 2; + } else if (wc < 0x110000) { + unsigned int wc1 = 0xd800 + ((wc - 0x10000) >> 10); + unsigned int wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff); + r[0] = (unsigned char) (wc1 & 0xff); + r[1] = (unsigned char) (wc1 >> 8); + r[2] = (unsigned char) (wc2 & 0xff); + r[3] = (unsigned char) (wc2 >> 8); + return 4; + } + } + return 0; +} + +/* + * UTF-32BE (libiconv-1.16/lib/utf32be.h) + */ + +/* ECI 34 UTF-32 Big Endian (ISO/IEC 10646) */ +static int utf32be_wctomb(unsigned char *r, const unsigned int wc) { + if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) { + r[0] = 0; + r[1] = (unsigned char) (wc >> 16); + r[2] = (unsigned char) (wc >> 8); + r[3] = (unsigned char) (wc & 0xff); + return 4; + } + return 0; +} + +/* + * UTF-32LE (libiconv-1.16/lib/utf32le.h) + */ + +/* ECI 35 UTF-32 Little Endian (ISO/IEC 10646) */ +static int utf32le_wctomb(unsigned char *r, const unsigned int wc) { + if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) { + r[0] = (unsigned char) (wc & 0xff); + r[1] = (unsigned char) (wc >> 8); + r[2] = (unsigned char) (wc >> 16); + r[3] = 0; + return 4; + } + return 0; +} + +/* vim: set ts=4 sw=4 et : */ +#endif /* Z_ECI_SB_H */ diff --git a/backend/gb18030.c b/backend/gb18030.c index 6efdfbd4..411dc4a9 100644 --- a/backend/gb18030.c +++ b/backend/gb18030.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019-2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ /* * Adapted from GNU LIBICONV library and patched to allow 2 duplicate mappings * for compatibility with GB 2312 (GB2312.TXT): @@ -2422,7 +2421,7 @@ static int gbkext_inv_wctomb(unsigned int *r, const unsigned int wc) { * GBK (libiconv-1.16/lib/gbk.h) */ -static int gbk_wctomb(unsigned int *r, const unsigned int wc) { +INTERNAL int gbk_wctomb_zint(unsigned int *r, const unsigned int wc) { int ret; /* ZINT: Note these mappings U+30FB and U+2015 different from GB 2312 */ @@ -2551,7 +2550,7 @@ static const unsigned short gb18030ext_pagefe[16] = { 0xa6ed, 0xa6f3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /*0x18-0x1f*/ }; -static int gb18030ext_wctomb(unsigned int *r, const unsigned int wc) { +STATIC_UNLESS_ZINT_TEST int gb18030ext_wctomb(unsigned int *r, const unsigned int wc) { unsigned short c = 0; if (wc == 0x01f9) { c = 0xa8bf; @@ -2725,7 +2724,7 @@ static const unsigned short gb18030uni_ranges[206] = { 25994, 25998, 26012, 26016, 26110, 26116 }; -static int gb18030uni_wctomb(unsigned int *r1, unsigned int *r2, const unsigned int wc) { +STATIC_UNLESS_ZINT_TEST int gb18030uni_wctomb(unsigned int *r1, unsigned int *r2, const unsigned int wc) { unsigned int i = wc; if (i >= 0x0080 && i <= 0xffff) { if (i == 0xe7c7) { @@ -2806,7 +2805,7 @@ INTERNAL int gb18030_wctomb_zint(unsigned int *r1, unsigned int *r2, const unsig } /* Code set 1 (GBK extended) */ - ret = gbk_wctomb(r1, wc); + ret = gbk_wctomb_zint(r1, wc); if (ret) { return ret; } @@ -2973,3 +2972,5 @@ INTERNAL void gb18030_cpy(const unsigned char source[], int *p_length, unsigned } } } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/gb18030.h b/backend/gb18030.h index 0f14db79..d6d0dbba 100644 --- a/backend/gb18030.h +++ b/backend/gb18030.h @@ -1,7 +1,7 @@ /* gb18030.h - Unicode to GB 18030 libzint - the open source barcode library - Copyright (C) 2009-2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -28,15 +28,15 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ -#ifndef GB18030_H -#define GB18030_H +#ifndef Z_GB18030_H +#define Z_GB18030_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +INTERNAL int gbk_wctomb_zint(unsigned int *r, const unsigned int wc); INTERNAL int gb18030_wctomb_zint(unsigned int *r1, unsigned int *r2, const unsigned int wc); INTERNAL int gb18030_utf8(struct zint_symbol *symbol, const unsigned char source[], int *p_length, unsigned int *gbdata); @@ -49,4 +49,5 @@ INTERNAL void gb18030_cpy(const unsigned char source[], int *p_length, unsigned } #endif /* __cplusplus */ -#endif /* GB18030_H */ +/* vim: set ts=4 sw=4 et : */ +#endif /* Z_GB18030_H */ diff --git a/backend/gridmtx.c b/backend/gridmtx.c index 84d8040a..aadf1372 100644 --- a/backend/gridmtx.c +++ b/backend/gridmtx.c @@ -1,7 +1,7 @@ /* gridmtx.c - Grid Matrix libzint - the open source barcode library - Copyright (C) 2009-2021 Robin Stuart + Copyright (C) 2009-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -28,7 +28,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ /* This file implements Grid Matrix as specified in AIM Global Document Number AIMD014 Rev. 1.63 Revised 9 Dec 2008 */ @@ -1011,6 +1010,7 @@ static void place_layer_id(char *grid, int size, int layers, int modules, int ec } INTERNAL int gridmatrix(struct zint_symbol *symbol, unsigned char source[], int length) { + int warn_number = 0; int size, modules, error_number; int auto_layers, min_layers, layers, auto_ecc_level, min_ecc_level, ecc_level; int x, y, i; @@ -1038,7 +1038,7 @@ INTERNAL int gridmatrix(struct zint_symbol *symbol, unsigned char source[], int gb2312_cpy(source, &length, gbdata, full_multibyte); } else { int done = 0; - if (symbol->eci != 29) { /* Unless ECI 29 (GB) */ + if (symbol->eci != 29) { /* Unless ECI 29 (GB 2312) */ /* Try other conversions (ECI 0 defaults to ISO/IEC 8859-1) */ error_number = gb2312_utf8_to_eci(symbol->eci, source, &length, gbdata, full_multibyte); if (error_number == 0) { @@ -1054,6 +1054,10 @@ INTERNAL int gridmatrix(struct zint_symbol *symbol, unsigned char source[], int if (error_number != 0) { return error_number; } + if (symbol->eci != 29) { + strcpy(symbol->errtxt, "540: Converted to GB 2312 but no ECI specified"); + warn_number = ZINT_WARN_NONCOMPLIANT; + } } } @@ -1237,5 +1241,7 @@ INTERNAL int gridmatrix(struct zint_symbol *symbol, unsigned char source[], int } symbol->height = size; - return 0; + return warn_number; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/hanxin.c b/backend/hanxin.c index 0ab00a94..9720bd30 100644 --- a/backend/hanxin.c +++ b/backend/hanxin.c @@ -1,7 +1,7 @@ /* hanxin.c - Han Xin Code libzint - the open source barcode library - Copyright (C) 2009-2021 Robin Stuart + Copyright (C) 2009-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -28,10 +28,9 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ -/* This code attempts to implement Han Xin Code according to ISO/IEC 20830 (draft 2019-10-10) - * (previously AIMD-015:2010 (Rev 0.8)) */ +/* This code attempts to implement Han Xin Code according to ISO/IEC 20830:2021 + * (previously ISO/IEC 20830 (draft 2019-10-10) and AIMD-015:2010 (Rev 0.8)) */ #include #ifdef _MSC_VER @@ -630,7 +629,7 @@ static void calculate_binary(char binary[], const char mode[], unsigned int sour bp = bin_append_posn(block_length + double_byte, 13, binary, bp); if (debug & ZINT_DEBUG_PRINT) { - printf("Binary (length %d)\n", block_length + double_byte); + printf("Binary Mode (%d):", block_length + double_byte); } i = 0; @@ -641,7 +640,7 @@ static void calculate_binary(char binary[], const char mode[], unsigned int sour bp = bin_append_posn(source[i + position], source[i + position] > 0xFF ? 16 : 8, binary, bp); if (debug & ZINT_DEBUG_PRINT) { - printf("%d ", (int) source[i + position]); + printf(" %02x", (int) source[i + position]); } i++; @@ -1142,14 +1141,11 @@ static void hx_set_function_info(unsigned char *grid, const int size, const int bp = bin_append_posn(fi_ecc[i], 4, function_information, bp); } - /* This alternating filler pattern at end not mentioned in ISO/IEC 20830 (draft 2019-10-10) and does not appear - * in Figure 1 or the figures in Annex K but does appear in Figure 2 and Figures 4-9 */ + /* Previously added alternating filler pattern here (as does BWIPP) but not mentioned in ISO/IEC 20830:2021 and + does not appear in Figure 1 nor in the figures in Annex K (although does appear in Figure 2 and Figures 4-9) + nor in the AIM ITS/04-023:2022 examples: so just clear */ for (i = 28; i < 34; i++) { - if (i & 1) { - function_information[i] = '1'; - } else { - function_information[i] = '0'; - } + function_information[i] = '0'; } if (debug & ZINT_DEBUG_PRINT) { @@ -1293,7 +1289,7 @@ static int hx_evaluate(const unsigned char *local, const int size) { * position of the module.” - however i being the length of the run of the * same colour (i.e. "block" below) in the same fashion as ISO/IEC 18004 * makes more sense. -- Confirmed by Wang Yi */ - /* Fixed in ISO/IEC 20830 (draft 2019-10-10) section 5.8.3.2 "In Table 12 below, i refers to the modules with + /* Fixed in ISO/IEC 20830 section 5.8.4.3 "In Table, i refers to the modules with same color." */ /* Vertical */ @@ -1341,8 +1337,8 @@ static int hx_evaluate(const unsigned char *local, const int size) { } /* Apply the four possible bitmasks for evaluation */ -/* TODO: Haven't been able to replicate (or even get close to) the penalty scores in ISO/IEC 20830 - * (draft 2019-10-10) Annex K examples; however they don't use alternating filler pattern on structural info */ +/* TODO: Haven't been able to replicate (or even get close to) the penalty scores in ISO/IEC 20830:2021 + * Annex K examples */ static void hx_apply_bitmask(unsigned char *grid, const int size, const int version, const int ecc_level, const int user_mask, const int debug) { int x, y; @@ -1447,6 +1443,7 @@ static void hx_apply_bitmask(unsigned char *grid, const int size, const int vers /* Han Xin Code - main */ INTERNAL int hanxin(struct zint_symbol *symbol, unsigned char source[], int length) { + int warn_number = 0; int est_binlen; int ecc_level = symbol->option_1; int i, j, j_max, version; @@ -1482,7 +1479,7 @@ INTERNAL int hanxin(struct zint_symbol *symbol, unsigned char source[], int leng gb18030_cpy(source, &length, gbdata, full_multibyte); } else { int done = 0; - if (symbol->eci != 29) { /* Unless ECI 29 (GB) */ + if (symbol->eci != 32) { /* Unless ECI 32 (GB 18030) */ /* Try other conversions (ECI 0 defaults to ISO/IEC 8859-1) */ int error_number = gb18030_utf8_to_eci(symbol->eci, source, &length, gbdata, full_multibyte); if (error_number == 0) { @@ -1498,6 +1495,10 @@ INTERNAL int hanxin(struct zint_symbol *symbol, unsigned char source[], int leng if (error_number != 0) { return error_number; } + if (symbol->eci != 32) { + strcpy(symbol->errtxt, "543: Converted to GB 18030 but no ECI specified"); + warn_number = ZINT_WARN_NONCOMPLIANT; + } } } @@ -1520,30 +1521,33 @@ INTERNAL int hanxin(struct zint_symbol *symbol, unsigned char source[], int leng if (bin_len & 0x07) { codewords++; } + if (symbol->debug & ZINT_DEBUG_PRINT) { + printf("Num. of codewords: %d\n", codewords); + } version = 85; for (i = 84; i > 0; i--) { switch (ecc_level) { case 1: - if (hx_data_codewords_L1[i - 1] > codewords) { + if (hx_data_codewords_L1[i - 1] >= codewords) { version = i; data_codewords = hx_data_codewords_L1[i - 1]; } break; case 2: - if (hx_data_codewords_L2[i - 1] > codewords) { + if (hx_data_codewords_L2[i - 1] >= codewords) { version = i; data_codewords = hx_data_codewords_L2[i - 1]; } break; case 3: - if (hx_data_codewords_L3[i - 1] > codewords) { + if (hx_data_codewords_L3[i - 1] >= codewords) { version = i; data_codewords = hx_data_codewords_L3[i - 1]; } break; case 4: - if (hx_data_codewords_L4[i - 1] > codewords) { + if (hx_data_codewords_L4[i - 1] >= codewords) { version = i; data_codewords = hx_data_codewords_L4[i - 1]; } @@ -1576,17 +1580,17 @@ INTERNAL int hanxin(struct zint_symbol *symbol, unsigned char source[], int leng /* Unless explicitly specified (within min/max bounds) by user */ if (symbol->option_1 == -1 || symbol->option_1 != ecc_level) { - if ((ecc_level == 1) && (codewords < hx_data_codewords_L2[version - 1])) { + if ((ecc_level == 1) && (codewords <= hx_data_codewords_L2[version - 1])) { ecc_level = 2; data_codewords = hx_data_codewords_L2[version - 1]; } - if ((ecc_level == 2) && (codewords < hx_data_codewords_L3[version - 1])) { + if ((ecc_level == 2) && (codewords <= hx_data_codewords_L3[version - 1])) { ecc_level = 3; data_codewords = hx_data_codewords_L3[version - 1]; } - if ((ecc_level == 3) && (codewords < hx_data_codewords_L4[version - 1])) { + if ((ecc_level == 3) && (codewords <= hx_data_codewords_L4[version - 1])) { ecc_level = 4; data_codewords = hx_data_codewords_L4[version - 1]; } @@ -1616,8 +1620,7 @@ INTERNAL int hanxin(struct zint_symbol *symbol, unsigned char source[], int leng } if (symbol->debug & ZINT_DEBUG_PRINT) { - printf("Datastream length: %d\n", data_codewords); - printf("Datastream:\n"); + printf("Datastream (%d): ", data_codewords); for (i = 0; i < data_codewords; i++) { printf("%.2x ", datastream[i]); } @@ -1631,6 +1634,14 @@ INTERNAL int hanxin(struct zint_symbol *symbol, unsigned char source[], int leng hx_add_ecc(fullstream, datastream, data_codewords, version, ecc_level); + if (symbol->debug & ZINT_DEBUG_PRINT) { + printf("Fullstream (%d): ", hx_total_codewords[version - 1]); + for (i = 0; i < hx_total_codewords[version - 1]; i++) { + printf("%.2x ", fullstream[i]); + } + printf("\n"); + } + make_picket_fence(fullstream, picket_fence, hx_total_codewords[version - 1]); /* Populate grid */ @@ -1665,5 +1676,7 @@ INTERNAL int hanxin(struct zint_symbol *symbol, unsigned char source[], int leng } symbol->height = size; - return 0; + return warn_number; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/qr.c b/backend/qr.c index 383d2851..0f88869b 100644 --- a/backend/qr.c +++ b/backend/qr.c @@ -1,7 +1,7 @@ /* qr.c Handles QR Code, Micro QR Code, UPNQR and rMQR libzint - the open source barcode library - Copyright (C) 2009 - 2021 Robin Stuart + Copyright (C) 2009-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -28,7 +28,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include #ifdef _MSC_VER @@ -1541,6 +1540,7 @@ static int getBinaryLength(const int version, char inputMode[], const unsigned i } INTERNAL int qrcode(struct zint_symbol *symbol, unsigned char source[], int length) { + int warn_number = 0; int i, j, est_binlen, prev_est_binlen; int ecc_level, autosize, version, max_cw, target_codewords, blocks, size; int bitmask, gs1; @@ -1593,6 +1593,10 @@ INTERNAL int qrcode(struct zint_symbol *symbol, unsigned char source[], int leng if (error_number != 0) { return error_number; } + if (symbol->eci != 20) { + strcpy(symbol->errtxt, "543: Converted to Shift JIS but no ECI specified"); + warn_number = ZINT_WARN_NONCOMPLIANT; + } } } @@ -1832,7 +1836,7 @@ INTERNAL int qrcode(struct zint_symbol *symbol, unsigned char source[], int leng } symbol->height = size; - return 0; + return warn_number; } static int micro_qr_m1(struct zint_symbol *symbol, char binary_data[], int bp) { @@ -2967,6 +2971,7 @@ static void setup_rmqr_grid(unsigned char *grid, const int h_size, const int v_s /* rMQR according to 2018 draft standard */ INTERNAL int rmqr(struct zint_symbol *symbol, unsigned char source[], int length) { + int warn_number = 0; int i, j, est_binlen; int ecc_level, autosize, version, max_cw, target_codewords, blocks, h_size, v_size; int gs1; @@ -3011,6 +3016,10 @@ INTERNAL int rmqr(struct zint_symbol *symbol, unsigned char source[], int length if (error_number != 0) { return error_number; } + if (symbol->eci != 20) { + strcpy(symbol->errtxt, "544: Converted to Shift JIS but no ECI specified"); + warn_number = ZINT_WARN_NONCOMPLIANT; + } } } @@ -3214,5 +3223,7 @@ INTERNAL int rmqr(struct zint_symbol *symbol, unsigned char source[], int length } symbol->height = v_size; - return 0; + return warn_number; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/data/tif/hanxin_v84_l4_scale2.tif b/backend/tests/data/tif/hanxin_v84_l4_scale2.tif index c908cb18..a69ee30b 100644 Binary files a/backend/tests/data/tif/hanxin_v84_l4_scale2.tif and b/backend/tests/data/tif/hanxin_v84_l4_scale2.tif differ diff --git a/backend/tests/test_2of5.c b/backend/tests/test_2of5.c index 7bdeb903..fa66e4f5 100644 --- a/backend/tests/test_2of5.c +++ b/backend/tests/test_2of5.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2020 - 2021 Robin Stuart + Copyright (C) 2020-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -349,11 +348,11 @@ static void test_encode(int index, int generate, int debug) { assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[8192 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -486,3 +485,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_aztec.c b/backend/tests/test_aztec.c index 33434925..851ceeda 100644 --- a/backend/tests/test_aztec.c +++ b/backend/tests/test_aztec.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2020 - 2021 Robin Stuart + Copyright (C) 2020-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -2440,11 +2439,11 @@ static void test_encode(int index, int generate, int debug) { i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[22801 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -3022,3 +3021,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_code.c b/backend/tests/test_code.c index 42374641..d7fe073a 100644 --- a/backend/tests/test_code.c +++ b/backend/tests/test_code.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2020 - 2021 Robin Stuart + Copyright (C) 2020-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -464,11 +463,11 @@ static void test_encode(int index, int generate, int debug) { assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[8192 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -605,3 +604,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_code128.c b/backend/tests/test_code128.c index 29296312..e2da4079 100644 --- a/backend/tests/test_code128.c +++ b/backend/tests/test_code128.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2020 - 2021 Robin Stuart + Copyright (C) 2020-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ /* Note BARCODE_GS1_128, BARCODE_EAN14, BARCODE_NVE18 also tested in test_gs1.c */ @@ -831,11 +830,11 @@ static void test_encode(int index, int generate, int debug) { i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[17984 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -972,3 +971,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_dmatrix.c b/backend/tests/test_dmatrix.c index 2c1217ff..2775d2cb 100644 --- a/backend/tests/test_dmatrix.c +++ b/backend/tests/test_dmatrix.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" #include "../gs1.h" @@ -976,11 +975,11 @@ static void test_input(int index, int generate, int debug) { i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, modules_dump); } } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; 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, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -1054,6 +1053,7 @@ static void test_encode(int index, int generate, int debug) { int option_2; int option_3; char *data; + int length; int ret; int expected_rows; @@ -1063,10 +1063,10 @@ static void test_encode(int index, int generate, int debug) { int expected_diff; // Difference between default minimal encodation and ISO encodation (FAST_MODE) char *expected; }; - // 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) and - // ANSI/HIBC PAS 1.3-2010 (HIBC/PAS), with noted exceptions + // 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 struct item data[] = { - /* 0*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "1234abcd", 0, 14, 14, 1, "", 0, + /* 0*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "1234abcd", -1, 0, 14, 14, 1, "", 0, "10101010101010" "11001010001111" "11000101100100" @@ -1082,7 +1082,7 @@ static void test_encode(int index, int generate, int debug) { "10011111000100" "11111111111111" }, - /* 1*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "1234abcd", 0, 14, 14, 1, "", 0, + /* 1*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "1234abcd", -1, 0, 14, 14, 1, "", 0, "10101010101010" "11001010001111" "11000101100100" @@ -1098,7 +1098,7 @@ static void test_encode(int index, int generate, int debug) { "10011111000100" "11111111111111" }, - /* 2*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "A1B2C3D4E5F6G7H8I9J0K1L2", 0, 18, 18, 1, "16022:2006 Figure 1", 0, + /* 2*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "A1B2C3D4E5F6G7H8I9J0K1L2", -1, 0, 18, 18, 1, "16022:2006 Figure 1", 0, "101010101010101010" "101000101010001111" "101100000111000010" @@ -1118,7 +1118,7 @@ static void test_encode(int index, int generate, int debug) { "100011000000100100" "111111111111111111" }, - /* 3*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "A1B2C3D4E5F6G7H8I9J0K1L2", 0, 18, 18, 1, "16022:2006 Figure 1", 0, + /* 3*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "A1B2C3D4E5F6G7H8I9J0K1L2", -1, 0, 18, 18, 1, "16022:2006 Figure 1", 0, "101010101010101010" "101000101010001111" "101100000111000010" @@ -1138,7 +1138,7 @@ static void test_encode(int index, int generate, int debug) { "100011000000100100" "111111111111111111" }, - /* 4*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "123456", 0, 10, 10, 1, "16022:2006 Figure O.2", 0, + /* 4*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "123456", -1, 0, 10, 10, 1, "16022:2006 Figure O.2", 0, "1010101010" "1100101101" "1100000100" @@ -1150,7 +1150,7 @@ static void test_encode(int index, int generate, int debug) { "1001110100" "1111111111" }, - /* 5*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "123456", 0, 10, 10, 1, "16022:2006 Figure O.2", 0, + /* 5*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "123456", -1, 0, 10, 10, 1, "16022:2006 Figure O.2", 0, "1010101010" "1100101101" "1100000100" @@ -1162,7 +1162,7 @@ static void test_encode(int index, int generate, int debug) { "1001110100" "1111111111" }, - /* 6*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "30Q324343430794\\R06\\G+/ACMRN123456/V2009121908334\\R\\E", 0, 20, 20, 1, "HIBC/PAS 1.3-2010 Section 2.2 Patient Id Macro, same", 0, + /* 48*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE | FAST_MODE, -1, -1, -1, -1, "[)>\\R06\\G+/ACMRN123456/V2009121908334\\R\\E", -1, 0, 20, 20, 1, "HIBC/PAS 1.3-2010 Section 2.2 Patient Id Macro, same", 0, "10101010101010101010" "10000000001110001111" "11010101001010011100" @@ -2084,7 +2084,7 @@ static void test_encode(int index, int generate, int debug) { "11100110001010111010" "11111111111111111111" }, - /* 49*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, -1, -1, "[)>\\R06\\G+/ACMRN123456/V2009121908334\\R\\E", 0, 20, 20, 0, "HIBC/PAS 1.3-2010 Section 2.2 Patient Id Macro **NOT SAME** (see FAST_MODE); BWIPP same as FAST_MODE", 0, + /* 49*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, -1, -1, "[)>\\R06\\G+/ACMRN123456/V2009121908334\\R\\E", -1, 0, 20, 20, 0, "HIBC/PAS 1.3-2010 Section 2.2 Patient Id Macro **NOT SAME** (see FAST_MODE); BWIPP same as FAST_MODE", 0, "10101010101010101010" "11111011001110001111" "11100100001010011100" @@ -2106,7 +2106,7 @@ static void test_encode(int index, int generate, int debug) { "11011111001010100010" "11111111111111111111" }, - /* 50*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, -1, "/EO523201", 0, 14, 14, 1, "HIBC/PAS Section 2.2 Purchase Order, same", 0, + /* 50*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, -1, "/EO523201", -1, 0, 14, 14, 1, "HIBC/PAS Section 2.2 Purchase Order, same", 0, "10101010101010" "10011001010101" "11101000011010" @@ -2122,7 +2122,7 @@ static void test_encode(int index, int generate, int debug) { "10010010000100" "11111111111111" }, - /* 51*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, "/EO523201", 0, 14, 14, 1, "HIBC/PAS Section 2.2 Purchase Order, same", 0, + /* 51*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, "/EO523201", -1, 0, 14, 14, 1, "HIBC/PAS Section 2.2 Purchase Order, same", 0, "10101010101010" "10011001010101" "11101000011010" @@ -2138,7 +2138,7 @@ static void test_encode(int index, int generate, int debug) { "10010010000100" "11111111111111" }, - /* 52*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, DM_SQUARE, "/EU720060FF0/O523201", 0, 18, 18, 1, "HIBC/PAS Section 2.2 2nd Purchase Order, same", 0, + /* 52*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, DM_SQUARE, "/EU720060FF0/O523201", -1, 0, 18, 18, 1, "HIBC/PAS Section 2.2 2nd Purchase Order, same", 0, "101010101010101010" "100110010100100001" "111011110110010110" @@ -2158,7 +2158,7 @@ static void test_encode(int index, int generate, int debug) { "111000010011001010" "111111111111111111" }, - /* 53*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, DM_SQUARE, "/EU720060FF0/O523201", 0, 18, 18, 1, "HIBC/PAS Section 2.2 2nd Purchase Order, same", 0, + /* 53*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, DM_SQUARE, "/EU720060FF0/O523201", -1, 0, 18, 18, 1, "HIBC/PAS Section 2.2 2nd Purchase Order, same", 0, "101010101010101010" "100110010100100001" "111011110110010110" @@ -2178,7 +2178,7 @@ static void test_encode(int index, int generate, int debug) { "111000010011001010" "111111111111111111" }, - /* 54*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, -1, "/EU720060FF0/O523201/Z34H159/M9842431340", 0, 22, 22, 1, "HIBC/PAS Section 2.2 3rd Purchase Order (left), same", 0, + /* 54*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, -1, "/EU720060FF0/O523201/Z34H159/M9842431340", -1, 0, 22, 22, 1, "HIBC/PAS Section 2.2 3rd Purchase Order (left), same", 0, "1010101010101010101010" "1001100101001000000011" "1110111101100001111010" @@ -2202,7 +2202,7 @@ static void test_encode(int index, int generate, int debug) { "1010110000010001001000" "1111111111111111111111" }, - /* 55*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, "/EU720060FF0/O523201/Z34H159/M9842431340", 0, 22, 22, 1, "HIBC/PAS Section 2.2 3rd Purchase Order (left), same", 0, + /* 55*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, "/EU720060FF0/O523201/Z34H159/M9842431340", -1, 0, 22, 22, 1, "HIBC/PAS Section 2.2 3rd Purchase Order (left), same", 0, "1010101010101010101010" "1001100101001000000011" "1110111101100001111010" @@ -2226,7 +2226,7 @@ static void test_encode(int index, int generate, int debug) { "1010110000010001001000" "1111111111111111111111" }, - /* 56*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE | FAST_MODE, -1, -1, -1, -1, "[)>\\R06\\G+/EU720060FF0/O523201/Z34H159/M9842431340V\\R\\E", 0, 22, 22, 1, "HIBC/PAS Section 2.2 3rd Purchase Order (right), same", 0, + /* 56*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE | FAST_MODE, -1, -1, -1, -1, "[)>\\R06\\G+/EU720060FF0/O523201/Z34H159/M9842431340V\\R\\E", -1, 0, 22, 22, 1, "HIBC/PAS Section 2.2 3rd Purchase Order (right), same", 0, "1010101010101010101010" "1000000000111010011101" "1101011100101001011100" @@ -2250,7 +2250,7 @@ static void test_encode(int index, int generate, int debug) { "1001110110011101101000" "1111111111111111111111" }, - /* 57*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, -1, -1, "[)>\\R06\\G+/EU720060FF0/O523201/Z34H159/M9842431340V\\R\\E", 0, 22, 22, 1, "HIBC/PAS Section 2.2 3rd Purchase Order (right), same", 0, + /* 57*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, -1, -1, "[)>\\R06\\G+/EU720060FF0/O523201/Z34H159/M9842431340V\\R\\E", -1, 0, 22, 22, 1, "HIBC/PAS Section 2.2 3rd Purchase Order (right), same", 0, "1010101010101010101010" "1000000000111010011101" "1101011100101001011100" @@ -2274,7 +2274,7 @@ static void test_encode(int index, int generate, int debug) { "1001110110011101101000" "1111111111111111111111" }, - /* 58*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, -1, "/E+/KN12345", 0, 16, 16, 1, "HIBC/PAS Section 2.2 Asset Tag **NOT SAME** check digit 'A' in figure is for '/KN12345', but actual data is as given here, when check digit is 'J'", 0, + /* 58*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, -1, "/E+/KN12345", -1, 0, 16, 16, 1, "HIBC/PAS Section 2.2 Asset Tag **NOT SAME** check digit 'A' in figure is for '/KN12345', but actual data is as given here, when check digit is 'J'", 0, "1010101010101010" "1001101010001111" "1110001000101100" @@ -2292,7 +2292,7 @@ static void test_encode(int index, int generate, int debug) { "1001000000000010" "1111111111111111" }, - /* 59*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, "/E+/KN12345", 0, 16, 16, 0, "HIBC/PAS Section 2.2 Asset Tag **NOT SAME** see above; BWIPP same as FAST_MODE", 0, + /* 59*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, "/E+/KN12345", -1, 0, 16, 16, 0, "HIBC/PAS Section 2.2 Asset Tag **NOT SAME** see above; BWIPP same as FAST_MODE", 0, "1010101010101010" "1100011011001011" "1101100111000110" @@ -2310,7 +2310,7 @@ static void test_encode(int index, int generate, int debug) { "1001111001100010" "1111111111111111" }, - /* 60*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, -1, "/LAH123/NC903", 0, 16, 16, 1, "HIBC/PAS Section 2.2 Surgical Instrument, same", 0, + /* 60*/ { BARCODE_HIBC_DM, FAST_MODE, -1, -1, -1, -1, "/LAH123/NC903", -1, 0, 16, 16, 1, "HIBC/PAS Section 2.2 Surgical Instrument, same", 0, "1010101010101010" "1001010001010001" "1110010100000100" @@ -2328,7 +2328,7 @@ static void test_encode(int index, int generate, int debug) { "1100000101010010" "1111111111111111" }, - /* 61*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, "/LAH123/NC903", 0, 16, 16, 0, "HIBC/PAS Section 2.2 Surgical Instrument **NOT SAME** (see FAST_MODE); BWIPP same as FAST_MODE", 0, + /* 61*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, -1, "/LAH123/NC903", -1, 0, 16, 16, 0, "HIBC/PAS Section 2.2 Surgical Instrument **NOT SAME** (see FAST_MODE); BWIPP same as FAST_MODE", 0, "1010101010101010" "1111000001001111" "1110010001010110" @@ -2346,7 +2346,7 @@ static void test_encode(int index, int generate, int debug) { "1110011111101010" "1111111111111111" }, - /* 62*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE | FAST_MODE, -1, -1, 7, -1, "[)>\\R06\\G18VD89536\\G1P8902A\\GS3122A02965\\R\\E", 0, 22, 22, 1, "ANSI MH10.8.17-2017 Figure 4 Macro06 **NOT SAME** 253-state randomising of padding in figure seems incorrect", 0, + /* 62*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE | FAST_MODE, -1, -1, 7, -1, "[)>\\R06\\G18VD89536\\G1P8902A\\GS3122A02965\\R\\E", -1, 0, 22, 22, 1, "ANSI MH10.8.17-2017 Figure 4 Macro06 **NOT SAME** 253-state randomising of padding in figure seems incorrect", 0, "1010101010101010101010" "1101110000111001011011" "1010111010001010001110" @@ -2370,7 +2370,7 @@ static void test_encode(int index, int generate, int debug) { "1000001010010010110100" "1111111111111111111111" }, - /* 63*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, 7, -1, "[)>\\R06\\G18VD89536\\G1P8902A\\GS3122A02965\\R\\E", 0, 22, 22, 1, "ANSI MH10.8.17-2017 Figure 4 Macro06 **NOT SAME** 253-state randomising of padding in figure seems incorrect", 0, + /* 63*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, 7, -1, "[)>\\R06\\G18VD89536\\G1P8902A\\GS3122A02965\\R\\E", -1, 0, 22, 22, 1, "ANSI MH10.8.17-2017 Figure 4 Macro06 **NOT SAME** 253-state randomising of padding in figure seems incorrect", 0, "1010101010101010101010" "1101110000111001011011" "1010111010001010001110" @@ -2394,7 +2394,7 @@ static void test_encode(int index, int generate, int debug) { "1000001010010010110100" "1111111111111111111111" }, - /* 64*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE | FAST_MODE, -1, -1, -1, -1, "[)>\\R06\\G25S0614141MH80312\\R\\E", 0, 16, 16, 1, "ANSI MH10.8.17-2017 Table B.1 B7", 0, + /* 64*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE | FAST_MODE, -1, -1, -1, -1, "[)>\\R06\\G25S0614141MH80312\\R\\E", -1, 0, 16, 16, 1, "ANSI MH10.8.17-2017 Table B.1 B7", 0, "1010101010101010" "1101000010101111" "1011100001011100" @@ -2412,7 +2412,7 @@ static void test_encode(int index, int generate, int debug) { "1010101010001010" "1111111111111111" }, - /* 65*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, -1, -1, "[)>\\R06\\G25S0614141MH80312\\R\\E", 0, 16, 16, 1, "ANSI MH10.8.17-2017 Table B.1 B7", 0, + /* 65*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, -1, -1, "[)>\\R06\\G25S0614141MH80312\\R\\E", -1, 0, 16, 16, 1, "ANSI MH10.8.17-2017 Table B.1 B7", 0, "1010101010101010" "1101000010101111" "1011100001011100" @@ -2430,7 +2430,7 @@ static void test_encode(int index, int generate, int debug) { "1010101010001010" "1111111111111111" }, - /* 66*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE | FAST_MODE, -1, -1, -1, -1, "[)>\\R05\\G80040614141MH80312\\R\\E", 0, 16, 16, 1, "ANSI MH10.8.17-2017 Table B.1 B8", 0, + /* 66*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE | FAST_MODE, -1, -1, -1, -1, "[)>\\R05\\G80040614141MH80312\\R\\E", -1, 0, 16, 16, 1, "ANSI MH10.8.17-2017 Table B.1 B8", 0, "1010101010101010" "1111100010001111" "1010100001100100" @@ -2448,7 +2448,7 @@ static void test_encode(int index, int generate, int debug) { "1010000010101010" "1111111111111111" }, - /* 67*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, -1, -1, "[)>\\R05\\G80040614141MH80312\\R\\E", 0, 16, 16, 1, "ANSI MH10.8.17-2017 Table B.1 B8", 0, + /* 67*/ { BARCODE_DATAMATRIX, DATA_MODE | ESCAPE_MODE, -1, -1, -1, -1, "[)>\\R05\\G80040614141MH80312\\R\\E", -1, 0, 16, 16, 1, "ANSI MH10.8.17-2017 Table B.1 B8", 0, "1010101010101010" "1111100010001111" "1010100001100100" @@ -2466,7 +2466,1217 @@ static void test_encode(int index, int generate, int debug) { "1010000010101010" "1111111111111111" }, - /* 68*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, 3, -1, -1, -1, "\101\300", 0, 12, 12, 1, "AÀ", 0, + /* 68*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 3, -1, -1, -1, "sn:7QPB4MN", -1, 0, 16, 16, 1, "AIM ITS/04-023:2022 ECI 3 Example 1", 0, + "1010101010101010" + "1001001011100001" + "1000111110110000" + "1100100110000001" + "1000110111101010" + "1100100110001111" + "1000010110000110" + "1000010000000001" + "1001101001111110" + "1001100011010111" + "1011100110011110" + "1000010111011101" + "1101000010001110" + "1110101001000101" + "1001011001111010" + "1111111111111111" + }, + /* 69*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 3, -1, -1, -1, "price:£20.00", -1, 0, 12, 26, 1, "AIM ITS/04-023:2022 ECI 3 Example 2", 0, + "10101010101010101010101010" + "10000111010111000110110001" + "10000101101010010011011000" + "11001010011000000101110111" + "10010101000100111011110110" + "11100111000100111100000001" + "11100101111110001101011100" + "10000011101101110011110011" + "11011100101111100110010110" + "10101101100110000001001011" + "11100101010110100111011000" + "11111111111111111111111111" + }, + /* 70*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 3, -1, -1, -1, "C:\\DOCS\\EXAMPLE.TXT", -1, 0, 18, 18, 1, "AIM ITS/04-023:2022 ECI 3 Example 3", 0, + "101010101010101010" + "100000001010011011" + "100010111000011100" + "110010001000010111" + "100011100110001110" + "110001010100010001" + "101000000010110100" + "111000000111100111" + "100010101110101110" + "111101011100000111" + "101101110100111010" + "110000101011100001" + "100110010100111110" + "100000000100010101" + "111011010100011000" + "101111000111101111" + "100110001010000100" + "111111111111111111" + }, + /* 71*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 4, -1, -1, -1, "Študentska št. 2198390", -1, 0, 20, 20, 0, "AIM ITS/04-023:2022 ECI 4 Example 1; BWIPP same as FAST_MODE", 0, + "10101010101010101010" + "10001110100110101111" + "10001101000001010110" + "11011010011101011001" + "10111110101000101110" + "11010110111111100111" + "10011001111111100000" + "10011111111111010001" + "11000110110101100100" + "11101101010011000011" + "10111110101011001110" + "10100100100110000101" + "10111010000001010010" + "10011010111010000001" + "10100010001110111000" + "10001101001000100111" + "10110101100001100110" + "11111110001010111101" + "11010000001001011010" + "11111111111111111111" + }, + /* 72*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 4, -1, 10, -1, "Szczegółowe dane kontaktowe:+48 22 694 60 00", -1, 0, 32, 32, 0, "AIM ITS/04-023:2022 ECI 4 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, + "10101010101010101010101010101010" + "10010010111100111011110110001111" + "10001111110010101000001000100000" + "11011101001100111001111111000101" + "10011101100110001100001101011110" + "11101101011101011001100000100101" + "11000111000010101110001010011110" + "11010100010000011000001100101111" + "11100010001100101001011100110110" + "11101011010001011001110000000001" + "10000101111001001011000111011000" + "10000110001011111011010001001111" + "10010101010000101001101110111000" + "10011001000101011111000011101101" + "11011111100011101100010000000010" + "11111111111111111111111111111111" + "10101010101010101010101010101010" + "10011011100000011001000100011101" + "11011100111100001111011111100100" + "11011011110010011111110101100011" + "11101111000110101101001000001000" + "10110101101110011111100100010011" + "10011001101101101001001000100000" + "10101010111010111100000011000111" + "10011011001000101010001001000010" + "10011101101000111010100010100101" + "11100000000001001110111100101110" + "10011011100010111011101110011101" + "11101101111111101110111001010100" + "10001010101011111111110010011101" + "11001100101101101010010101100000" + "11111111111111111111111111111111" + }, + /* 73*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 5, -1, -1, DM_SQUARE, "Liĥtenŝtejno", -1, 0, 18, 18, 0, "AIM ITS/04-023:2022 ECI 5 Example 1; BWIPP different encodation", 0, + "101010101010101010" + "100101101010111011" + "100011010100011110" + "111010101110110111" + "100001111010000110" + "111100110100011001" + "111111110000101000" + "110111110111011111" + "101101101001101110" + "101011010001100011" + "110100011000000110" + "111101010011111011" + "101010100110001100" + "100010001100010111" + "110101100101101010" + "100010011100100101" + "110001011101010110" + "111111111111111111" + }, + /* 74*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 6, -1, -1, DM_SQUARE, "Lietuvą", -1, 0, 16, 16, 1, "AIM ITS/04-023:2022 ECI 6 Example 1", 0, + "1010101010101010" + "1001011011110111" + "1000010100001110" + "1111100101001101" + "1001110010001110" + "1111010011100111" + "1110100001010110" + "1100000101010001" + "1101101001001100" + "1110101111100011" + "1101111011100110" + "1011100001101101" + "1011000111011100" + "1100101001001101" + "1100100101110010" + "1111111111111111" + }, + /* 75*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 7, -1, -1, DM_SQUARE, "Россия", -1, 0, 16, 16, 1, "AIM ITS/04-023:2022 ECI 7 Example 1", 0, + "1010101010101010" + "1001110110001111" + "1001101010110100" + "1000101100100101" + "1001100010101000" + "1110010011110111" + "1100000001110110" + "1111100110000001" + "1010001010001110" + "1001110101110011" + "1011111000110000" + "1011011010100111" + "1101110011100110" + "1000011010101101" + "1010110001000010" + "1111111111111111" + }, + /* 76*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 7, -1, -1, DM_SQUARE, "Монголулс", -1, 0, 18, 18, 1, "AIM ITS/04-023:2022 ECI 7 Example 2", 0, + "101010101010101010" + "100111100010010101" + "100110000111111110" + "100010111010101111" + "100100001110101110" + "111000111100001001" + "110000100010111110" + "110100010111111111" + "101110001001110010" + "100011100101100111" + "110001001010011100" + "100101010001110101" + "100111110110111000" + "101001010101111001" + "110011000110000000" + "101111110101011001" + "110100011110000100" + "111111111111111111" + }, + /* 77*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 8, -1, -1, DM_SQUARE, "جواز السفر", -1, 0, 18, 18, 1, "AIM ITS/04-023:2022 ECI 8 Example 1", 0, + "101010101010101010" + "100111100010000001" + "100110001111110010" + "100111111010101111" + "100100001010101110" + "111010111100010001" + "110100100010111010" + "111100100111011001" + "111011111001110010" + "101111001111111001" + "110010100101010100" + "101110100110100011" + "111100100010101110" + "110010000001110111" + "100000010011010100" + "101111111100011101" + "101100011100001010" + "111111111111111111" + }, + /* 78*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 8, -1, -1, -1, "المنشأ: المملكة العربية السعودية", -1, 0, 24, 24, 1, "AIM ITS/04-023:2022 ECI 8 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + "101010101010101010101010" + "100111010010111011001011" + "100110111100000010010000" + "100111000000111111001101" + "100101110011111110100010" + "111001010001001001101111" + "111101010101110101101110" + "111100001011010001101001" + "101011110001111111000110" + "100011100010010100001011" + "101011100111000111010010" + "111101010101001011010111" + "100000001011111111110110" + "110010000011010101000101" + "101010110001010010010010" + "111011000011110111111011" + "111100001100000111000110" + "111100010101100000100011" + "101111110010011001101110" + "100001110110010001100101" + "101010101000001101111100" + "110101100100100111001101" + "100111000101101010110010" + "111111111111111111111111" + }, + /* 79*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 9, -1, -1, DM_SQUARE, "Μέρος #. α123", -1, 0, 18, 18, 1, "AIM ITS/04-023:2022 ECI 9 Example 1", 0, + "101010101010101010" + "100111100100000011" + "100110001111001100" + "101011100001110111" + "100100011010100110" + "110111001000011001" + "101110100000101000" + "101110010110111101" + "101111101000101100" + "100000110010100111" + "111010011011010100" + "110101010110001101" + "111110011101000010" + "101100110111110101" + "101011110001111000" + "111110011110011011" + "111100011110101000" + "111111111111111111" + }, + /* 80*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 10, -1, -1, -1, "דרכון", -1, 0, 8, 32, 1, "AIM ITS/04-023:2022 ECI 10 Example 1", 0, + "10101010101010101010101010101010" + "10011101110010011001011101110101" + "10011110001001001011101011110100" + "10110010001000011011100111101101" + "11011110000110101111101011010010" + "11111110111110011001000100101111" + "11010100010001101010000011101010" + "11111111111111111111111111111111" + }, + /* 81*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 10, -1, -1, -1, "מספר חלק: A20200715001", -1, 0, 20, 20, 0, "AIM ITS/04-023:2022 ECI 10 Example 2 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + "10101010101010101010" + "10011110011111000111" + "10011101101010101110" + "10110111101100111001" + "10010101111010010100" + "11110010110001000001" + "10011011101000111110" + "10110010000111000011" + "10011111010101010000" + "10111100110011010101" + "11001000110110100100" + "10111100100000111101" + "10101001000011001110" + "11000110100101000001" + "10011110101101011000" + "10000110110111011111" + "10110001001101110100" + "11100100101110010101" + "11000111100100101010" + "11111111111111111111" + }, + /* 82*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 10, -1, -1, -1, "מספר חלק: A20200715001", -1, 0, 20, 20, 1, "AIM ITS/04-023:2022 ECI 10 Example 2 **NOT SAME** different encodation", 0, + "10101010101010101010" + "10011101100001000111" + "10011111111110010110" + "10110111101101001001" + "10010101111011010100" + "11110010110100101101" + "10011011101101111010" + "10110010001101100011" + "10011110001010100010" + "10111101001110011101" + "11001000111010000100" + "10110001001011000101" + "10000101101011001010" + "11110110001101010101" + "10010111111001100100" + "10011101010100110111" + "10111011001110011010" + "11110101100100001101" + "11000111010001111010" + "11111111111111111111" + }, + /* 83*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 11, -1, -1, -1, "Amerika Birleşik Devletleri", -1, 0, 22, 22, 0, "AIM ITS/04-023:2022 ECI 11 Example 1 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + "1010101010101010101010" + "1000101011001011000001" + "1001111101111001101100" + "1100101110111111111011" + "1001111000001110111000" + "1111011101001001000011" + "1110110000001101101010" + "1010011101010101100111" + "1110010001101000110110" + "1001000101111010101001" + "1110011011110111010000" + "1100110101100001100011" + "1100110000000000101010" + "1001011001011010011101" + "1101011110000110010010" + "1100111000110011110101" + "1011010110110111000010" + "1011111110101100100001" + "1110100000001110110100" + "1101100010010110011111" + "1110010000010000011110" + "1111111111111111111111" + }, + /* 84*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 11, -1, -1, -1, "Amerika Birleşik Devletleri", -1, 0, 22, 22, 1, "AIM ITS/04-023:2022 ECI 11 Example 1 **NOT SAME** different encodation", 0, + "1010101010101010101010" + "1001110011001011001001" + "1001111001111001110100" + "1100000110111110100011" + "1001011000001110110000" + "1111011101001000110011" + "1110110000001101001000" + "1010011101010101110111" + "1110010001101011101110" + "1001000101111000001001" + "1110011011110011000100" + "1100110101100100101111" + "1100110000000101011010" + "1001011001100001100001" + "1101011110100001100100" + "1100111001000111011101" + "1011011100010000111010" + "1011110101000111110001" + "1110110111010111100000" + "1101110111000000010011" + "1110111101000010011110" + "1111111111111111111111" + }, + /* 85*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 11, -1, -1, -1, "Biniş kartı #120921039", -1, 0, 20, 20, 0, "AIM ITS/04-023:2022 ECI 11 Example 2; BWIPP different encodation", 0, + "10101010101010101010" + "10001110101011111111" + "10010101011000110110" + "11001010110110010001" + "10011111100000111010" + "11101010111000111011" + "11010100101001000000" + "10101010001011000001" + "11110110110010001010" + "10010000100110111011" + "11001001111000001110" + "10010100000101101111" + "11101111000001110100" + "11000001110100111111" + "10101110011101100000" + "11111011111011101101" + "11010011001001110000" + "10101100011011001101" + "10000100110101011010" + "11111111111111111111" + }, + /* 86*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 12, -1, -1, -1, "Kūrybiškumą", -1, 0, 12, 26, 0, "AIM ITS/04-023:2022 ECI 12 Example 1 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + "10101010101010101010101010" + "10010010000111001101100011" + "10011111110110110110111000" + "11011100100001101101111111" + "10011100000110010100001110" + "11000100011101011100010001" + "10000100101011100011011010" + "10100101000001111110101001" + "11010001001001001000011100" + "10111001001111010000000101" + "10011101110100000011000100" + "11111111111111111111111111" + }, + /* 87*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 12, -1, -1, -1, "Kūrybiškumą", -1, 0, 12, 26, 1, "AIM ITS/04-023:2022 ECI 12 Example 1 **NOT SAME** different encodation", 0, + "10101010101010101010101010" + "10011110000111001010011111" + "10010001010110110011110000" + "11011100100001101000000111" + "10011110000110000000100110" + "11000100011100111011101001" + "10000100101011000010101010" + "10100101000100100110000001" + "11010010001010110101011000" + "11111001101111110000010001" + "11000101010100110000011010" + "11111111111111111111111111" + }, + /* 88*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 13, -1, -1, -1, "บาร๋แค่ด", -1, 0, 16, 16, 1, "AIM ITS/04-023:2022 ECI 13 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + "1010101010101010" + "1001110100011001" + "1001101111101000" + "1110100100111111" + "1001110111011110" + "1101001000100111" + "1110001010011110" + "1110111010010001" + "1111111001100010" + "1001000000100101" + "1100101010000100" + "1100010011100011" + "1100000011101000" + "1000011111010101" + "1001010001001010" + "1111111111111111" + }, + /* 89*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 15, -1, -1, -1, "uzņēmums", -1, 0, 16, 16, 0, "AIM ITS/04-023:2022 ECI 15 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, + "1010101010101010" + "1001101111101001" + "1010110111010100" + "1000101010000001" + "1001011110010000" + "1111001100011111" + "1101110101111110" + "1010111001100001" + "1111100011000010" + "1011100000101111" + "1101000010001000" + "1110000111000111" + "1001010000011010" + "1101001001100101" + "1110011001011010" + "1111111111111111" + }, + /* 90*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 16, -1, -1, -1, "ṁórṡáċ", -1, 0, 8, 32, 1, "AIM ITS/04-023:2022 ECI 16 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010101010101010101010" + "10011101001100111111001100100101" + "10101011110110101011000000111100" + "10011001010000111001101100000001" + "11010010010000001010011001001110" + "11110110101100011111111110011101" + "11101100010001001001011110100100" + "11111111111111111111111111111111" + }, + /* 91*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 17, -1, -1, -1, "Price: €13.50", -1, 0, 12, 26, 1, "AIM ITS/04-023:2022 ECI 17 Example 1", 0, + "10101010101010101010101010" + "10000111000111101110001001" + "10100101110010111101000010" + "10101011110111010110100111" + "10010101011010010000100110" + "11100000110001000100010001" + "11100100110010110111101100" + "10000001101110111010011011" + "11011100101111110001001110" + "10101101110001111000111101" + "10100111000100011110100110" + "11111111111111111111111111" + }, + /* 92*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 18, -1, -1, -1, "Te słowa są głębokie", -1, 0, 22, 22, 0, "AIM ITS/04-023:2022 ECI 18 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, + "1010101010101010101010" + "1001011001001010011011" + "1010001101110111011000" + "1011100010011110110111" + "1001001100010100000100" + "1111011101010000101101" + "1110010000110101100100" + "1000110111110101011111" + "1110000000001000110110" + "1111110111111001001001" + "1110010001111100101010" + "1110100011100100111111" + "1101011101010010001010" + "1011011000011101110111" + "1100001001111010101110" + "1011000111000111100101" + "1000001001000010111110" + "1010010010111111100001" + "1100110001011001111000" + "1110101010111001011011" + "1011000010010101000110" + "1111111111111111111111" + }, + /* 93*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 20, -1, -1, -1, "バーコード", -1, 0, 12, 26, 0, "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" + "11011010011110110101110111" + "10111111011000110101101110" + "11110110100001110010111001" + "10001000110010011001110110" + "11100110101110111000101101" + "10100100101011100010101100" + "11100010001011010011110111" + "11000110001100101101001010" + "11111111111111111111111111" + }, + /* 94*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 20, -1, -1, DM_SQUARE, "東京都", -1, 0, 16, 16, 0, "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" + "1101111100001101" + "1000111010111110" + "1100110011010111" + "1011000011111110" + "1000100111111001" + "1111100000001010" + "1111000101101011" + "1010110001100000" + "1110010000001001" + "1001011000001110" + "1110111011010101" + "1010010001000010" + "1111111111111111" + }, + /* 95*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 21, -1, -1, -1, "Študentska št. 2198390", -1, 0, 20, 20, 0, "AIM ITS/04-023:2022 ECI 21 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, + "10101010101010101010" + "10001100100001100111" + "10100101100110111110" + "11101100001010110001" + "10111011100101011110" + "11101101000100110001" + "11111011100011001110" + "11000000111110011001" + "11100111111110101000" + "11000111111000011001" + "11011011010111011110" + "11100101100111011011" + "11111011111100110010" + "11010100101010011001" + "11101100100010111110" + "11110000011100100001" + "10011011000111010100" + "11111100011000100101" + "11010010011010100010" + "11111111111111111111" + }, + /* 96*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 22, -1, -1, DM_SQUARE, "Россия", -1, 0, 16, 16, 1, "AIM ITS/04-023:2022 ECI 22 Example 1", 0, + "1010101010101010" + "1001110111011111" + "1010101011100000" + "1111111101000011" + "1001100010101000" + "1111010011011111" + "1000000001100110" + "1011100100000001" + "1010101000111000" + "1001111010011001" + "1101100010010000" + "1011011010001001" + "1110100000111100" + "1001011100110101" + "1011010001101010" + "1111111111111111" + }, + /* 97*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 22, -1, -1, DM_SQUARE, "Монголулс", -1, 0, 18, 18, 1, "AIM ITS/04-023:2022 ECI 22 Example 2", 0, + "101010101010101010" + "100111100100010101" + "101010000001111110" + "111111111010101111" + "100100010110101110" + "111100111100011001" + "100001000010111100" + "100110010111100101" + "101000111000100010" + "100011110100101111" + "111011111000101000" + "100111100001100101" + "100011110010101010" + "100000110010101001" + "110111010111100000" + "100110011101011001" + "101100011000000110" + "111111111111111111" + }, + /* 98*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 23, -1, -1, -1, "bœuf", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 23 Example 1", 0, + "10101010101010" + "10001110110001" + "10110001110100" + "10000110111101" + "10011010110010" + "11110101110101" + "11110010010000" + "10001111000111" + "11110111110110" + "10000001100001" + "11010110100000" + "10010000100111" + "11000001001110" + "11111111111111" + }, + /* 99*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 24, -1, -1, DM_SQUARE, "جواز السفر", -1, 0, 18, 18, 1, "AIM ITS/04-023:2022 ECI 24 Example 1", 0, + "101010101010101010" + "100111100010000001" + "101110001110110010" + "100111111110101111" + "100100001010101110" + "111010111100011001" + "110000010010100010" + "111101110110110001" + "111011011001101010" + "101111100101000111" + "110000010001000010" + "101111110011000011" + "110001010110100110" + "110010011100010111" + "111110101000110000" + "101111100010001011" + "110100011110001010" + "111111111111111111" + }, + /*100*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 24, -1, -1, -1, "المنشأ: المملكة العربية السعودية", -1, 0, 24, 24, 1, "AIM ITS/04-023:2022 ECI 24 Example 2", 0, + "101010101010101010101010" + "100111010010001001001011" + "101110111100001110010010" + "100111000000111111011011" + "100101110011101110101110" + "111001010001001001101111" + "110111010100010101101110" + "111100001001000110001001" + "111011111001111100101010" + "100011100010010101011111" + "101011100111100110010100" + "111101010101101010010011" + "100000001011110011010100" + "110010000001000011100101" + "101010110101010110001010" + "111011110111011101000001" + "100100011011100100110010" + "111100001100111100001111" + "101110101011010110101110" + "100001100100001100100001" + "101110110011010001010110" + "110001111011100111011101" + "101111000110001010111010" + "111111111111111111111111" + }, + /*101*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 25, -1, -1, -1, "条码", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 25 Example 1", 0, + "10101010101010" + "10000010011111" + "10110101011100" + "10101111001101" + "10000011101100" + "11000000010111" + "10010000010100" + "10000100010111" + "10101101011110" + "11001100011001" + "11111010000010" + "10011010101101" + "10011101010100" + "11111111111111" + }, + /*102*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 25, -1, -1, -1, "バーコード", -1, 0, 12, 26, 1, "AIM ITS/04-023:2022 ECI 25 Example 2", 0, + "10101010101010101010101010" + "10011110010000001001101001" + "10110000101111001011001010" + "10100111011011101110100111" + "10011000011000010000110110" + "11010010110001100111100001" + "11010110110011000110001100" + "10110011101011011111000001" + "10010111101001011101001100" + "11100100000101010101100011" + "11000100100011011100111100" + "11111111111111111111111111" + }, + /*103*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 25, -1, -1, -1, "바코드", -1, 0, 8, 32, 1, "AIM ITS/04-023:2022 ECI 25 Example 3 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010101010101010101010" + "10011101000111111101100100000101" + "10111011100010101000011111001100" + "10101011100111111110100111110101" + "11100001000110001100000000111010" + "11010111110011111111000101100111" + "11110100011001101010111111010110" + "11111111111111111111111111111111" + }, + /*104*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, DM_SQUARE, "条码", -1, 0, 16, 16, 1, "AIM ITS/04-023:2022 ECI 26 Example 1", 0, + "1010101010101010" + "1001110111110101" + "1011111011000100" + "1011010100111001" + "1000010010010100" + "1101110011001111" + "1011100000010110" + "1110100111001001" + "1010111100111110" + "1110010111011111" + "1100111010000100" + "1011111101000011" + "1111111101100100" + "1000011100010101" + "1001110001111010" + "1111111111111111" + }, + /*105*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, -1, "バーコード", -1, 0, 20, 20, 1, "AIM ITS/04-023:2022 ECI 26 Example 2", 0, + "10101010101010101010" + "10011110001010000111" + "10111111000100111110" + "10110011010001010001" + "10001110001111011010" + "11000011100100001011" + "10101010000101000000" + "10110001001001100101" + "10001010000000001000" + "11110010000011010101" + "10001010010001011010" + "11100001110010000001" + "10110010011000110000" + "10011010010111000111" + "11111111110100000110" + "11010100111101001001" + "11001010010001101000" + "11101000000101101101" + "11000101001001010010" + "11111111111111111111" + }, + /*106*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, DM_SQUARE, "바코드", -1, 0, 18, 18, 1, "AIM ITS/04-023:2022 ECI 26 Example 3", 0, + "101010101010101010" + "100111100000010101" + "101111000110111110" + "101101010101101111" + "100011101010101110" + "111100111100001001" + "100100110010110010" + "101010010110000111" + "100101011000001010" + "100100001110010001" + "100011010111100000" + "100011100010101101" + "111111010100001010" + "110010001001001001" + "100111011011000110" + "100110110111011111" + "101100010110000100" + "111111111111111111" + }, + /*107*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 27, -1, -1, -1, "sn:7QPB4MN", -1, 0, 16, 16, 1, "AIM ITS/04-023:2022 ECI 27 Example 1", 0, + "1010101010101010" + "1001001011000001" + "1011111111011000" + "1100100111101001" + "1000110111011100" + "1100100110000111" + "1000010110101110" + "1000010011010001" + "1001101001110110" + "1001100011110011" + "1011000000011110" + "1000110001100001" + "1110101111011010" + "1110001011011101" + "1001011001110010" + "1111111111111111" + }, + /*108*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 28, -1, -1, -1, "條碼", -1, 0, 14, 14, 0, "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" + "11010111110001" + "10011010100010" + "11111111100101" + "11010001010100" + "11000100010111" + "10110010111110" + "10011001011001" + "10000111110010" + "11110001100001" + "10101101000110" + "11111111111111" + }, + /*109*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 29, -1, -1, -1, "条码", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 29 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010" + "10011101000111" + "10111011101100" + "11101111110101" + "10010001000000" + "11110000101001" + "11111100101110" + "11100000001111" + "11011110100110" + "10000000101001" + "10111010101110" + "10100011110101" + "11001101000100" + "11111111111111" + }, + /*110*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 29, -1, -1, -1, "北京", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 29 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010" + "10011101000101" + "10111011100110" + "11100110001111" + "10001011110100" + "11110000010111" + "11011111000000" + "11000100101111" + "11001101001110" + "10100100101001" + "10000101101110" + "10011001110001" + "10101101000110" + "11111111111111" + }, + /*111*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 30, -1, -1, -1, "바코드", -1, 0, 8, 32, 1, "AIM ITS/04-023:2022 ECI 30 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010101010101010101010" + "10011101010000111110011110001101" + "10111011100001101011001100110000" + "11111001111110111010010000010001" + "11011010110111101010001000101010" + "11011111001011111001111111100111" + "11011100010101101110100010101010" + "11111111111111111111111111111111" + }, + /*112*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 30, -1, -1, -1, "서울", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 30 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010" + "10011101010111" + "10111011100110" + "11111011101101" + "10000000001100" + "11101010010111" + "11111000111000" + "11000111001111" + "11101101011110" + "11110110000001" + "10110010011110" + "11011101100001" + "11001101000110" + "11111111111111" + }, + /*113*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 31, -1, -1, -1, "条码", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 31 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010" + "10011101010111" + "11001011110100" + "10001111000101" + "10010001011100" + "11110011111001" + "11111010101000" + "11110100011111" + "11001001011110" + "10011000100001" + "11100001000110" + "11000111110101" + "11000111000100" + "11111111111111" + }, + /*114*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 31, -1, -1, -1, "北京", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 31 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010" + "10011101010101" + "11001011111110" + "10000110111111" + "10001011101000" + "11110011000111" + "11011001000110" + "11010000111111" + "11011010110110" + "10111100100001" + "11011110000110" + "11111101110001" + "10100111000110" + "11111111111111" + }, + /*115*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 31, -1, -1, -1, "條碼", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 31 Example 3 **NOT SAME** different encodation (example uses binary)", 0, + "10101010101010" + "10001101110001" + "11000100010000" + "10001011110011" + "10111011000000" + "11101111000101" + "10011100000110" + "11010101100111" + "10101011010110" + "10000111111001" + "11000110110000" + "11001111101011" + "10110111010010" + "11111111111111" + }, + /*116*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, -1, "条码", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 32 Example 1 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010" + "10011101011111" + "11001011111000" + "10011110010101" + "10010000011000" + "11110011000001" + "11111001000010" + "11100101010111" + "11011110110110" + "10010011011001" + "10001110010010" + "10110101101101" + "11000001000100" + "11111111111111" + }, + /*117*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, -1, "北京", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 32 Example 2 **NOT SAME** example sets explicit BASE256 byte count", 0, + "10101010101010" + "10011101011101" + "11001011110010" + "10010111101111" + "10001010101100" + "11110011111111" + "11011010101100" + "11000001110111" + "11001101011110" + "10110111011001" + "10110001010010" + "10001111101001" + "10100001000110" + "11111111111111" + }, + /*118*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, -1, "條碼", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 32 Example 3 **NOT SAME** different encodation (example uses binary)", 0, + "10101010101010" + "10001101111001" + "11000100011100" + "10011010100011" + "10111010000100" + "11101111111101" + "10011111101100" + "11000100101111" + "10111100111110" + "10001100000001" + "10101001100100" + "10111101110011" + "10110001010010" + "11111111111111" + }, + /*119*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, DM_SQUARE, "པེ་ཅིང།", -1, 0, 24, 24, 0, "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" + "100110100010001000000001" + "101010111101111000100010" + "111100101011010111001111" + "101001001000011100000110" + "101000101100101001110001" + "100001001111101011100100" + "111010001100111101101101" + "100011010001011011110000" + "110010010111110001101011" + "101101111000101100010010" + "110000111010011001110111" + "101111000010001111001100" + "101001000110000010101101" + "101011101110010001100100" + "100101000100111011001101" + "111101101010011000011010" + "111110011100101001001111" + "100010111101101000111100" + "111001111000001100100101" + "110001000101110010010010" + "111111111111111111111111" + }, + /*120*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, DM_SQUARE, "バーコード", -1, 0, 18, 18, 1, "AIM ITS/04-023:2022 ECI 32 Example 5", 0, + "101010101010101010" + "100111100000000001" + "110010001111110010" + "100101001110101111" + "100100110010101110" + "110100010000010001" + "110100100010100110" + "100101110111001001" + "101001001001110100" + "111011101000110011" + "110101001000010110" + "100010101000110001" + "110111110111101000" + "111011011001100101" + "101001011011110000" + "101111010001101001" + "101100011101111000" + "111111111111111111" + }, + /*121*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 32, -1, -1, DM_SQUARE, "바코드", -1, 0, 18, 18, 0, "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" + "100110100011110111" + "101011111110100110" + "111100110100011001" + "100100100000100000" + "101000110111110001" + "101001001000001000" + "111100011010000111" + "100001001010100000" + "111011011010000111" + "111010101010001010" + "101001100101100111" + "101101011010111010" + "110111110000100111" + "101100010101010110" + "111111111111111111" + }, + /*122*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, -1, -1, -1, "条码", -1, 0, 14, 14, 1, "AIM ITS/04-023:2022 ECI 33 Example 1", 0, + "10101010101010" + "10001010110111" + "11000000010100" + "10100000001001" + "10010101100000" + "11111000100001" + "10001100000010" + "10011110011111" + "10101010010110" + "10101011001001" + "10110010011110" + "11110100111101" + "10010001000100" + "11111111111111" + }, + /*123*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, -1, -1, DM_SQUARE, "バーコード", -1, 0, 18, 18, 0, "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" + "101011100010101111" + "101010011010101110" + "111100110000011001" + "100101010010100100" + "110000100110100001" + "100001011001010010" + "111000011111011101" + "111001011000110110" + "111001011110000111" + "111110001110011010" + "111101110110011101" + "110111001100001000" + "110111010110011001" + "111100010111101010" + "111111111111111111" + }, + /*124*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 33, -1, -1, -1, "바코드", -1, 0, 8, 32, 0, "AIM ITS/04-023:2022 ECI 33 Example 3 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + "10101010101010101010101010101010" + "10010110001111011011011000110101" + "11001111111100101000100000101000" + "10101010110011011010101011101001" + "11001001010111101111001001100010" + "11111001001000011000100000000011" + "11110010110110101110001111110110" + "11111111111111111111111111111111" + }, + /*125*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 33, -1, -1, -1, "바코드", -1, 0, 8, 32, 1, "AIM ITS/04-023:2022 ECI 33 Example 3 **NOT SAME** different encodation", 0, + "10101010101010101010101010101010" + "10011101001111011010111110010101" + "11000011111111101000110111000100" + "10100000110010111111011010110001" + "11000001010111001000101111100010" + "11111111000000011001110101101111" + "11110100011100101110011010101000" + "11111111111111111111111111111111" + }, + /*126*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, -1, -1, -1, "条码", -1, 0, 8, 32, 1, "AIM ITS/04-023:2022 ECI 34 Example 1", 0, + "10101010101010101010101010101010" + "10000100000001011001100100101101" + "11000100100001001101100101100100" + "10111010000110111100110000101101" + "11010000001011001000011010110010" + "11100000010100111100110101101011" + "11010000001111101100000001100110" + "11111111111111111111111111111111" + }, + /*127*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, -1, -1, -1, "バーコード", -1, 0, 22, 22, 0, "AIM ITS/04-023:2022 ECI 34 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, + "1010101010101010101010" + "1000010001011111000001" + "1100000010110010010000" + "1011110000010011001001" + "1011001000111010010010" + "1110010000101001001011" + "1011101110111101010000" + "1011111000010101100111" + "1010110110101000110110" + "1010000011111001101001" + "1000100111111111110100" + "1011101011101111100011" + "1101100101100000011000" + "1100011000010100101011" + "1111001010000011111100" + "1111000101010110000011" + "1110001011000011100110" + "1110010101000001110101" + "1010101000111011110110" + "1000001001000110011101" + "1101110000000101011100" + "1111111111111111111111" + }, + /*128*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 34, -1, -1, DM_SQUARE, "바코드", -1, 0, 18, 18, 0, "AIM ITS/04-023:2022 ECI 34 Example 3 **NOT SAME** different encodation; BWIPP same as FAST_MODE", 0, + "101010101010101010" + "100001000101111111" + "110011001011000000" + "101110001001110111" + "101011101110110110" + "110010000000010001" + "111001110000111010" + "110111010111011001" + "100011011001110010" + "101000000111010001" + "100000101011011110" + "101100011100110111" + "101100010100110000" + "111111100111000001" + "100001000011011000" + "100000101110010011" + "101000000011010110" + "111111111111111111" + }, + /*129*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 34, -1, -1, DM_SQUARE, "바코드", -1, 0, 18, 18, 0, "AIM ITS/04-023:2022 ECI 34 Example 3 **NOT SAME** different encodation", 0, + "101010101010101010" + "100111100101111111" + "110011011011000000" + "101110101001110111" + "101010001110110110" + "110000000000011001" + "110101110000111010" + "110111010110100001" + "100011011000011110" + "101000011000101111" + "100011011111111000" + "101110111100011111" + "101101011010001000" + "110111011110011001" + "111000001110001000" + "100111100000010111" + "101100011111010100" + "111111111111111111" + }, + /*130*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, -1, -1, -1, "条码", -1, 0, 8, 32, 1, "AIM ITS/04-023:2022 ECI 35 Example 1", 0, + "10101010101010101010101010101010" + "10001010101001011001011111111101" + "11000000011111001011101110100000" + "11000000000110111000110111011101" + "11000010001110001111001100111110" + "11000010101100011100010000001011" + "11001100011110001000101111100010" + "11111111111111111111111111111111" + }, + /*131*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, -1, -1, -1, "バーコード", -1, 0, 22, 22, 0, "AIM ITS/04-023:2022 ECI 35 Example 2 **NOT SAME** different encodation; BWIPP different encodation", 0, + "1010101010101010101010" + "1001111010111100010001" + "1100100000010110000000" + "1100111001000110010101" + "1010100000110100011010" + "1111001100101000111011" + "1001010110011101101100" + "1110011011010101011111" + "1000010010101011011110" + "1000000111111000011001" + "1111100111110011001000" + "1111110011101010000001" + "1100000101000111111000" + "1100111000001001100101" + "1011101010011011100000" + "1101000100111000010101" + "1010000001011110010100" + "1000010110001001000101" + "1000011101101100111000" + "1001011111010100100111" + "1000011100010000111100" + "1111111111111111111111" + }, + /*132*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 35, -1, -1, DM_SQUARE, "바코드", -1, 0, 18, 18, 0, "AIM ITS/04-023:2022 ECI 35 Example 3 **NOT SAME** different encodation; BWIPP different encodation", 0, + "101010101010101010" + "100101100010110001" + "110011111110000010" + "110011000101000111" + "100010100010001110" + "111110110000011001" + "101101010000110000" + "111101100111001101" + "100100011001111100" + "110111100000101011" + "101001011010101000" + "111111001010001101" + "110001011011010100" + "111100111001011101" + "111011010101100100" + "110000000111111111" + "110010110111000000" + "111111111111111111" + }, + /*133*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 170, -1, -1, -1, "sn:7QPB4MN", -1, 0, 16, 16, 1, "AIM ITS/04-023:2022 ECI 170 Example 1", 0, + "1010101010101010" + "1101001101000101" + "1000011000100000" + "1000101000101001" + "1011111101000010" + "1110000100111111" + "1011011000011110" + "1010011011010001" + "1000111011000100" + "1110001110110001" + "1000111001111000" + "1000100110001001" + "1101001101010000" + "1010000010100101" + "1101110101101010" + "1111111111111111" + }, + /*134*/ { BARCODE_DATAMATRIX, DATA_MODE, 899, -1, -1, -1, "\000\001\002\133\134\135\375\376\377", 9, 0, 12, 26, 0, "AIM ITS/04-023:2022 ECI 899 Example 1 **NOT SAME** different encodation; BWIPP different encodation", 0, + "10101010101010101010101010" + "11001100001001010101010111" + "10000000111000111010100110" + "10110001100110100000111111" + "10000101001011001101100110" + "11000011110001000000110001" + "11011011110011111011110000" + "11101110101110100010110101" + "10001101101001001110101110" + "10010110100111110011110111" + "10010010000010011010010100" + "11111111111111111111111111" + }, + /*135*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, 3, -1, -1, -1, "\101\300", -1, 0, 12, 12, 1, "AÀ", 0, "101010101010" "100010101111" "100001011110" @@ -2480,7 +3690,7 @@ static void test_encode(int index, int generate, int debug) { "100011011010" "111111111111" }, - /* 69*/ { BARCODE_DATAMATRIX, DATA_MODE, 3, -1, -1, -1, "\101\300", 0, 12, 12, 1, "AÀ", 0, + /*136*/ { BARCODE_DATAMATRIX, DATA_MODE, 3, -1, -1, -1, "\101\300", -1, 0, 12, 12, 1, "AÀ", 0, "101010101010" "100010101111" "100001011110" @@ -2494,7 +3704,7 @@ static void test_encode(int index, int generate, int debug) { "100011011010" "111111111111" }, - /* 70*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 26, -1, -1, -1, "AÀ", 0, 14, 14, 1, "AÀ", 0, + /*137*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, 26, -1, -1, -1, "AÀ", -1, 0, 14, 14, 1, "AÀ", 0, "10101010101010" "10001010100001" "10110101100100" @@ -2510,7 +3720,7 @@ static void test_encode(int index, int generate, int debug) { "11000110001100" "11111111111111" }, - /* 71*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, -1, "AÀ", 0, 14, 14, 1, "AÀ", 0, + /*138*/ { BARCODE_DATAMATRIX, UNICODE_MODE, 26, -1, -1, -1, "AÀ", -1, 0, 14, 14, 1, "AÀ", 0, "10101010101010" "10001010100001" "10110101100100" @@ -2526,7 +3736,7 @@ static void test_encode(int index, int generate, int debug) { "11000110001100" "11111111111111" }, - /* 72*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, -1, -1, -1, DM_SQUARE, "abcdefgh+", 0, 16, 16, 1, "TEX last_shift 2, symbols_left 1, process_p 1", 0, + /*139*/ { BARCODE_DATAMATRIX, UNICODE_MODE | FAST_MODE, -1, -1, -1, DM_SQUARE, "abcdefgh+", -1, 0, 16, 16, 1, "TEX last_shift 2, symbols_left 1, process_p 1", 0, "1010101010101010" "1010011011101001" "1011001010010010" @@ -2544,7 +3754,7 @@ static void test_encode(int index, int generate, int debug) { "1101110101001010" "1111111111111111" }, - /* 73*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, -1, -1, DM_SQUARE, "abcdefgh+", 0, 14, 14, 0, "ATTTTTTTT; BWIPP same as FAST_MODE", 1, + /*140*/ { BARCODE_DATAMATRIX, UNICODE_MODE, -1, -1, -1, DM_SQUARE, "abcdefgh+", -1, 0, 14, 14, 0, "ATTTTTTTT; BWIPP same as FAST_MODE", 1, "10101010101010" "11100001010101" "11010101001000" @@ -2560,7 +3770,7 @@ static void test_encode(int index, int generate, int debug) { "10111011000100" "11111111111111" }, - /* 74*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200", 0, 8, 32, 1, "7 BASE256s, 1 pad", 0, + /*141*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, "7 BASE256s, 1 pad", 0, "10101010101010101010101010101010" "10000101000011011000110100100001" "11100111110101001011101110100010" @@ -2570,7 +3780,7 @@ static void test_encode(int index, int generate, int debug) { "11010000111100001010011101100100" "11111111111111111111111111111111" }, - /* 75*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200", 0, 8, 32, 1, "7 BASE256s, 1 pad", 0, + /*142*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, "7 BASE256s, 1 pad", 0, "10101010101010101010101010101010" "10000101000011011000110100100001" "11100111110101001011101110100010" @@ -2580,7 +3790,7 @@ static void test_encode(int index, int generate, int debug) { "11010000111100001010011101100100" "11111111111111111111111111111111" }, - /* 76*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200", 0, 8, 32, 1, "8 BASE256s, no padding", 0, + /*143*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, "8 BASE256s, no padding", 0, "10101010101010101010101010101010" "10000101000011011111001101000001" "11010111110101001001011001100010" @@ -2590,7 +3800,7 @@ static void test_encode(int index, int generate, int debug) { "11010000110010001001010001111000" "11111111111111111111111111111111" }, - /* 77*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200", 0, 8, 32, 1, "8 BASE256s, no padding", 0, + /*144*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200", -1, 0, 8, 32, 1, "8 BASE256s, no padding", 0, "10101010101010101010101010101010" "10000101000011011111001101000001" "11010111110101001001011001100010" @@ -2600,7 +3810,7 @@ static void test_encode(int index, int generate, int debug) { "11010000110010001001010001111000" "11111111111111111111111111111111" }, - /* 78*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, DM_SQUARE, "\200\200\200\200\200\200\200\200\200\200", 0, 16, 16, 1, "8 BASE256s, square, no padding", 0, + /*145*/ { 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, "8 BASE256s, square, no padding", 0, "1010101010101010" "1000010100001101" "1101011111101110" @@ -2618,7 +3828,7 @@ static void test_encode(int index, int generate, int debug) { "1111000011111010" "1111111111111111" }, - /* 79*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, DM_SQUARE, "\200\200\200\200\200\200\200\200\200\200", 0, 16, 16, 1, "8 BASE256s, square, no padding", 0, + /*146*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, DM_SQUARE, "\200\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, "8 BASE256s, square, no padding", 0, "1010101010101010" "1000010100001101" "1101011111101110" @@ -2636,7 +3846,7 @@ static void test_encode(int index, int generate, int debug) { "1111000011111010" "1111111111111111" }, - /* 80*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200", 0, 16, 16, 1, "9 BASE256s, 1 pad", 0, + /*147*/ { BARCODE_DATAMATRIX, DATA_MODE | FAST_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, "9 BASE256s, 1 pad", 0, "1010101010101010" "1000010101001101" "1110011111000010" @@ -2654,7 +3864,7 @@ static void test_encode(int index, int generate, int debug) { "1100000011011010" "1111111111111111" }, - /* 81*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200", 0, 16, 16, 1, "9 BASE256s, 1 pad", 0, + /*148*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, -1, -1, -1, "\200\200\200\200\200\200\200\200\200", -1, 0, 16, 16, 1, "9 BASE256s, 1 pad", 0, "1010101010101010" "1000010101001101" "1110011111000010" @@ -2672,7 +3882,7 @@ static void test_encode(int index, int generate, int debug) { "1100000011011010" "1111111111111111" }, - /* 82*/ { 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", 0, 22, 22, 1, "22 BASE256s, 6 pads", 0, + /*149*/ { 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, "22 BASE256s, 6 pads", 0, "1010101010101010101010" "1010010100011100010101" "1000011110111110001100" @@ -2696,7 +3906,7 @@ static void test_encode(int index, int generate, int debug) { "1111101000110111010100" "1111111111111111111111" }, - /* 83*/ { 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", 0, 22, 22, 1, "22 BASE256s, 6 pads", 0, + /*150*/ { 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, "22 BASE256s, 6 pads", 0, "1010101010101010101010" "1010010100011100010101" "1000011110111110001100" @@ -2720,7 +3930,7 @@ static void test_encode(int index, int generate, int debug) { "1111101000110111010100" "1111111111111111111111" }, - /* 84*/ { 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", 0, 8, 64, 1, "22 BASE256s, no padding", 0, + /*151*/ { 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, "22 BASE256s, no padding", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010101100011101010101011101111110100100110011100010011010111" "1101011110001010110000001110001010001011010111001010101101100000" @@ -2730,7 +3940,7 @@ static void test_encode(int index, int generate, int debug) { "1101000011001010111101101101110010111100111101001010010011001000" "1111111111111111111111111111111111111111111111111111111111111111" }, - /* 85*/ { 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", 0, 8, 64, 1, "22 BASE256s, no padding", 0, + /*152*/ { 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, "22 BASE256s, no padding", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010101100011101010101011101111110100100110011100010011010111" "1101011110001010110000001110001010001011010111001010101101100000" @@ -2740,7 +3950,7 @@ static void test_encode(int index, int generate, int debug) { "1101000011001010111101101101110010111100111101001010010011001000" "1111111111111111111111111111111111111111111111111111111111111111" }, - /* 86*/ { 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", 0, 64, 64, 1, "249 BASE256s + 6 ASCII (3 double-digits)", 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\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\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, "249 BASE256s + 6 ASCII (3 double-digits)", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010100011101100000010111100110100010110111011011111010000001" "1100011110111110100110111101111010101101000010001101001011001100" @@ -2806,7 +4016,7 @@ static void test_encode(int index, int generate, int debug) { "1000001101010100110010010110101010000000001010101100100011101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /* 87*/ { 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", 0, 64, 64, 1, "249 BASE256s + 6 ASCII (3 double-digits)", 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\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\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, "249 BASE256s + 6 ASCII (3 double-digits)", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1000010100011101100000010111100110100010110111011011111010000001" "1100011110111110100110111101111010101101000010001101001011001100" @@ -2872,7 +4082,7 @@ static void test_encode(int index, int generate, int debug) { "1000001101010100110010010110101010000000001010101100100011101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /* 88*/ { 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", 0, 64, 64, 0, "249 BASE256s + 8 ASCII (Sh A80 + 3 double-digits); BWIPP uses 2nd B256 length byte instead of ASCII shift (same no. of codewords)", 0, + /*155*/ { 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, "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" @@ -2938,7 +4148,7 @@ static void test_encode(int index, int generate, int debug) { "1000001101010100110100010100101010001100001000101100101001101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /* 89*/ { 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", 0, 64, 64, 0, "249 BASE256s + 8 ASCII (Sh A80 + 3 double-digits); BWIPP uses 2nd B256 length byte instead of ASCII shift (same no. of codewords)", 0, + /*156*/ { 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, "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" @@ -3004,7 +4214,7 @@ static void test_encode(int index, int generate, int debug) { "1000001101010100110100010100101010001100001000101100101001101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /* 90*/ { 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", 0, 64, 64, 1, "10 ASCII + 251 BASE256s + 6 ASCII", 0, + /*157*/ { 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, "10 ASCII + 251 BASE256s + 6 ASCII", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1010011010011101100000010111100110100010110111011011111010000001" "1011001010111110100110111101111010101101000010001101001011001100" @@ -3070,7 +4280,7 @@ static void test_encode(int index, int generate, int debug) { "1001010101010100111010010100101010000010001011001100101011101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /* 91*/ { 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", 0, 64, 64, 0, "10 ASCII + 251 BASE256s + 6 ASCII; BWIPP same as FAST_MODE", 0, + /*158*/ { 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, "10 ASCII + 251 BASE256s + 6 ASCII; BWIPP same as FAST_MODE", 0, "1010101010101010101010101010101010101010101010101010101010101010" "1010011010011101100000010111100110100010110111011011111010000001" "1011001010111110100110111101111010101101000010001101001011001100" @@ -3136,7 +4346,7 @@ static void test_encode(int index, int generate, int debug) { "1001010101010100111110010100001010001100001000001100100011101010" "1111111111111111111111111111111111111111111111111111111111111111" }, - /* 92*/ { 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", 0, 88, 88, 1, "10 ASCII + 252 BASE256s + 10 ASCII + 253 BASE256 + 6 ASCII", 0, + /*159*/ { 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, "10 ASCII + 252 BASE256s + 10 ASCII + 253 BASE256 + 6 ASCII", 0, "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "1010011010011100000001110111100010001011011111001111101000000110011111111000100110101111" "1011001010111110011010111101111010110100001010010100101100110010101011111110101001100000" @@ -3226,7 +4436,7 @@ static void test_encode(int index, int generate, int debug) { "1101010100110101110000110100001000100000101010010010101110100111001111100010001001001100" "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /* 93*/ { 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", 0, 88, 88, 0, "10 ASCII + 252 BASE256s + 10 ASCII + 253 BASE256 + 6 ASCII; BWIPP same as FAST_MODE", 0, + /*160*/ { 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, "10 ASCII + 252 BASE256s + 10 ASCII + 253 BASE256 + 6 ASCII; BWIPP same as FAST_MODE", 0, "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "1010011010011100000001110111100010001011011111001111101000000110011111111000100110101111" "1011001010111110011010111101111010110100001010010100101100110010101011111110101001100000" @@ -3316,7 +4526,7 @@ static void test_encode(int index, int generate, int debug) { "1101010100110101110000110100101000010000100010110010111110101011001111100010000101001100" "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /* 94*/ { 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", 0, 88, 88, 1, "10 ASCII + 252 BASE256s + 10 ASCII + 304 BASE256, no padding", 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\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, "10 ASCII + 252 BASE256s + 10 ASCII + 304 BASE256, no padding", 0, "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "1010011010011100000001110111100010001011011111001111101000000110011111111000100110101111" "1011001010111110011010111101111010110100001010010100101100110010101011111110101001100000" @@ -3406,7 +4616,7 @@ static void test_encode(int index, int generate, int debug) { "1101010100110101100000110110001000001000101011110010001110100101001111000010001111001100" "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /* 95*/ { 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", 0, 88, 88, 0, "10 ASCII + 252 BASE256s + 10 ASCII + 304 BASE256, no padding; 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\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, "10 ASCII + 252 BASE256s + 10 ASCII + 304 BASE256, no padding; BWIPP same as FAST_MODE", 0, "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "1010011010011100000001110111100010001011011111001111101000000110011111111000100110101111" "1011001010111110011010111101111010110100001010010100101100110010101011111110101001100000" @@ -3496,7 +4706,7 @@ static void test_encode(int index, int generate, int debug) { "1101010100110101100000110110101000111000100011010010011110101001001111000010000011001100" "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /* 96*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@_", 0, 8, 32, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 2 chars, not last 3 like Zint", 0, + /*163*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@_", -1, 0, 8, 32, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 2 chars, not last 3 like Zint", 0, "10101010101010101010101010101010" "10000000001001111001101100001101" "10000000000001001001110011001100" @@ -3506,7 +4716,7 @@ static void test_encode(int index, int generate, int debug) { "11000000000000001001000001011010" "11111111111111111111111111111111" }, - /* 97*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@_", 0, 8, 32, 0, "EDI **NOT SAME** (see FAST_MODE); BWIPP uses different encodation", 0, + /*164*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@_", -1, 0, 8, 32, 0, "EDI **NOT SAME** (see FAST_MODE); BWIPP uses different encodation", 0, "10101010101010101010101010101010" "11100000000000011000100100101001" "11100000000000001010011101001000" @@ -3516,7 +4726,7 @@ static void test_encode(int index, int generate, int debug) { "10000000000001001010010000010000" "11111111111111111111111111111111" }, - /* 98*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@_", 0, 16, 16, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 3 chars, not last 4 like Zint", 0, + /*165*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@_", -1, 0, 16, 16, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 3 chars, not last 4 like Zint", 0, "1010101010101010" "1000000001000001" "1000000000111110" @@ -3534,7 +4744,7 @@ static void test_encode(int index, int generate, int debug) { "1010100000010010" "1111111111111111" }, - /* 99*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@_", 0, 8, 32, 0, "AAEEEEEEEEA; BWIPP uses different encodation, see above", 1, + /*166*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@_", -1, 0, 8, 32, 0, "AAEEEEEEEEA; BWIPP uses different encodation, see above", 1, "10101010101010101010101010101010" "10100000000000111000110101111001" "10000000000001001000100100011000" @@ -3544,7 +4754,7 @@ static void test_encode(int index, int generate, int debug) { "10000110001100001001010000001110" "11111111111111111111111111111111" }, - /*100*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@_", 0, 16, 16, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 4 chars, not last 1 like Zint", 0, + /*167*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@_", -1, 0, 16, 16, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 4 chars, not last 1 like Zint", 0, "1010101010101010" "1000000001000001" "1000000000001100" @@ -3562,7 +4772,7 @@ static void test_encode(int index, int generate, int debug) { "1000100000100010" "1111111111111111" }, - /*101*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@_", 0, 16, 16, 0, "AAAEEEEEEEEA; BWIPP uses different encodation, see above", 0, + /*168*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@_", -1, 0, 16, 16, 0, "AAAEEEEEEEEA; BWIPP uses different encodation, see above", 0, "1010101010101010" "1010011101000001" "1000000000101000" @@ -3580,7 +4790,7 @@ static void test_encode(int index, int generate, int debug) { "1011000011010010" "1111111111111111" }, - /*102*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@@_", 0, 16, 16, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 5 chars, not last 2 like Zint", 0, + /*169*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@@_", -1, 0, 16, 16, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 5 chars, not last 2 like Zint", 0, "1010101010101010" "1000000000100001" "1000000000111000" @@ -3598,7 +4808,7 @@ static void test_encode(int index, int generate, int debug) { "1011100000010010" "1111111111111111" }, - /*103*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@@_", 0, 16, 16, 0, "EEEEEEEEEEEEA; BWIPP uses different encodation, see above", 1, + /*170*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@@_", -1, 0, 16, 16, 0, "EEEEEEEEEEEEA; BWIPP uses different encodation, see above", 1, "1010101010101010" "1000000001100001" "1000000000110100" @@ -3616,7 +4826,7 @@ static void test_encode(int index, int generate, int debug) { "1000000000100010" "1111111111111111" }, - /*104*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@@@_", 0, 12, 26, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 2 chars, not last 3 like Zint", 0, + /*171*/ { BARCODE_DATAMATRIX, FAST_MODE, -1, -1, -1, -1, "@@@@@@@@@@@@@_", -1, 0, 12, 26, 0, "EDI; BWIPP uses different encodation, switching to ASC for last 2 chars, not last 3 like Zint", 0, "10101010101010101010101010" "10000000001001100100101011" "10000000000010000000111000" @@ -3630,7 +4840,7 @@ static void test_encode(int index, int generate, int debug) { "10000001000001101011010000" "11111111111111111111111111" }, - /*105*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@@@_", 0, 16, 16, 0, "AEEEEEEEEEEEEA; BWIPP uses different encodation, see above", 1, + /*172*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, -1, "@@@@@@@@@@@@@_", -1, 0, 16, 16, 0, "AEEEEEEEEEEEEA; BWIPP uses different encodation, see above", 1, "1010101010101010" "1110000001000001" "1110000001000000" @@ -3648,7 +4858,7 @@ static void test_encode(int index, int generate, int debug) { "1001100000111010" "1111111111111111" }, - /*106*/ { BARCODE_DATAMATRIX, FAST_MODE, 26, -1, -1, -1, "abcdefghi1234FGHIJKLMNabc@@@@@@@@@é", 0, 24, 24, 0, "Mix of modes TEX ASC C40 ASC EDI BAS; BWIPP uses different encodation", 0, + /*173*/ { BARCODE_DATAMATRIX, FAST_MODE, 26, -1, -1, -1, "abcdefghi1234FGHIJKLMNabc@@@@@@@@@é", -1, 0, 24, 24, 0, "Mix of modes TEX ASC C40 ASC EDI BAS; BWIPP uses different encodation", 0, "101010101010101010101010" "100111011110011101000101" "101111001100101101101000" @@ -3674,7 +4884,7 @@ static void test_encode(int index, int generate, int debug) { "111101010110111111111010" "111111111111111111111111" }, - /*107*/ { BARCODE_DATAMATRIX, -1, 26, -1, -1, -1, "abcdefghi1234FGHIJKLMNabc@@@@@@@@@é", 0, 24, 24, 0, "TTTTTTTTTAAAACCCCCCCCCAAAAAEEEEEEEAA; BWIPP uses different encodation", 0, + /*174*/ { BARCODE_DATAMATRIX, -1, 26, -1, -1, -1, "abcdefghi1234FGHIJKLMNabc@@@@@@@@@é", -1, 0, 24, 24, 0, "TTTTTTTTTAAAACCCCCCCCCAAAAAEEEEEEEAA; BWIPP uses different encodation", 0, "101010101010101010101010" "100111011110011100000101" "101111001100101100111100" @@ -3700,7 +4910,7 @@ static void test_encode(int index, int generate, int debug) { "111011010111011111010010" "111111111111111111111111" }, - /*108*/ { 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&,:#-.$/+%*=^...............", 0, 132, 132, 0, "Mixed modes (except B256); BWIPP different encodation", 0, + /*175*/ { 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, "Mixed modes (except B256); BWIPP different encodation", 0, "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "101001101001010011000111100011111001011001011010011010010111111101110111100110110110000111110000111000011100111110111010111110010101" "101100101010110110010011000010100000111010101111010100001111001010100011010100110101000010101011010001111011001010111111011000100110" @@ -3834,7 +5044,7 @@ static void test_encode(int index, int generate, int debug) { "110101010100010111111010100000000000110011101101010011010100111010111011101111011111110010101110001010101110001010111111010011111110" "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" }, - /*109*/ { 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&,:#-.$/+%*=^...............", 0, 120, 120, 0, "Mixed modes (except B256); BWIPP uses different encodation", 13, + /*176*/ { 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, "Mixed modes (except B256); BWIPP uses different encodation", 13, "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "101001101001010011011001100011111001011110010010011011010111111101001110101111111010000001101101101110110111111011101011" "101100101010110110001101000010100000111010101111010101000000110001110101001100101001111100111000101011100101101011001100" @@ -3978,17 +5188,19 @@ static void test_encode(int index, int generate, int debug) { symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, data[i].eci, -1 /*option_1*/, data[i].option_2, data[i].option_3, data[i].output_options, data[i].data, -1, debug); + length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, data[i].eci, + -1 /*option_1*/, data[i].option_2, data[i].option_3, data[i].output_options, + data[i].data, data[i].length, debug); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d\n", i, ret, data[i].ret); if (generate) { - printf(" /*%3d*/ { %s, %s, %d, %s, %d, %s, \"%s\", %s, %d, %d, %d, \"%s\", %d,\n", + printf(" /*%3d*/ { %s, %s, %d, %s, %d, %s, \"%s\", %d, %s, %d, %d, %d, \"%s\", %d,\n", i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), data[i].eci, testUtilOutputOptionsName(data[i].output_options), data[i].option_2, testUtilOption3Name(data[i].option_3), - testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), + testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), data[i].length, testUtilErrorName(data[i].ret), symbol->rows, symbol->width, data[i].bwipp_cmp, data[i].comment, data[i].expected_diff); testUtilModulesPrint(symbol, " ", "\n"); @@ -4015,11 +5227,11 @@ static void test_encode(int index, int generate, int debug) { i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; 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, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -5352,3 +6564,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_dotcode.c b/backend/tests/test_dotcode.c index 3562f265..6f1bbf56 100644 --- a/backend/tests/test_dotcode.c +++ b/backend/tests/test_dotcode.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -1016,14 +1015,14 @@ static void test_encode(int index, int generate, int debug) { i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { if (!data[i].zxingcpp_cmp) { if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not ZXing-C++ compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); } else { int cmp_len, ret_len; char modules_dump[16384]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -1251,3 +1250,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_eci.c b/backend/tests/test_eci.c index 299deb11..d12f5da6 100644 --- a/backend/tests/test_eci.c +++ b/backend/tests/test_eci.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et norl : */ #include "testcommon.h" #include "../eci.h" @@ -204,7 +203,7 @@ static void test_reduced_charset_input(int index, int debug) { /* 64*/ { BARCODE_PDF417, UNICODE_MODE, 25, "ကက", 0, 25, "In UCS-2BE" }, /* 65*/ { BARCODE_PDF417, UNICODE_MODE, 25, "12", 0, 25, "UCS-2BE ASCII" }, /* 66*/ { BARCODE_PDF417, UNICODE_MODE, 0, "𐀀", ZINT_WARN_USES_ECI, 26, "Not in any single-byte page" }, - /* 67*/ { BARCODE_PDF417, UNICODE_MODE, 25, "𐀀", ZINT_ERROR_INVALID_DATA, -1, "Not in UCS-2BE (in Supplementary Plane)" }, + /* 67*/ { BARCODE_PDF417, UNICODE_MODE, 25, "𐀀", 0, 25, "UTF-16BE (in Supplementary Plane)" }, /* 68*/ { BARCODE_PDF417, UNICODE_MODE, 0, "テ", ZINT_WARN_USES_ECI, 26, "Defaults to UTF-8 if not in any ISO 8859 or Win page" }, /* 69*/ { BARCODE_PDF417, UNICODE_MODE, 26, "テ", 0, 26, "" }, /* 70*/ { BARCODE_PDF417, UNICODE_MODE, 26, "テテ", 0, 26, "" }, @@ -762,29 +761,37 @@ static void test_utf8_to_eci_ascii(void) { assert_zero(memcmp(data[i].data, dest, length), "i:%d memcmp != 0\n", i); } } -}; +} -static void test_utf8_to_eci_ucs2be(void) { +static void test_utf8_to_eci_utf16be(void) { struct item { - int eci; char *data; int length; int ret; int expected_length; + char *expected; }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { 25, "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 * 2 }, - /* 1*/ { 25, " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 * 2 }, - /* 2*/ { 25, "\302\200\357\277\277", -1, 0, 4 }, // U+0080 U+FFFF - /* 3*/ { 25, "\357\277\276", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+FFFE (reversed BOM) not allowed - /* 4*/ { 25, "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+D800 surrogate not allowed + /* 0*/ { "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 * 2, NULL }, + /* 1*/ { " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 * 2, NULL }, + /* 2*/ { "\302\200\357\277\277", -1, 0, 4, "\000\200\377\377" }, // U+0080 U+FFFF + /* 3*/ { "\357\277\276", -1, 0, 2, "\377\376" }, // U+FFFE (reversed BOM) allowed + /* 4*/ { "\357\273\277", -1, 0, 2, "\376\377" }, // U+FEFF (BOM) allowed + /* 5*/ { "\355\237\277", -1, 0, 2, "\327\377" }, // U+D7FF (ed9fbf) + /* 6*/ { "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // U+D800 (eda080) surrogate half not allowed + /* 7*/ { "\355\277\277", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // U+DFFF (edbfbf) surrogate half not allowed + /* 8*/ { "\356\200\200", -1, 0, 2, "\340\000" }, // U+E000 (ee8080) + /* 9*/ { "\360\220\200\200", -1, 0, 4, "\330\000\334\000" }, // U+10000 maps to surrogate pair + /* 10*/ { "\364\217\277\277", -1, 0, 4, "\333\377\337\377" }, // U+10FFFF maps to surrogate pair + /* 11*/ { "\364\220\200\200", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // Non-Unicode 0x110000 not allowed }; int data_size = ARRAY_SIZE(data); int i, length, ret; + const int eci = 25; - testStart("test_utf8_to_eci_ucs2be"); + testStart("test_utf8_to_eci_utf16be"); for (i = 0; i < data_size; i++) { int out_length, eci_length; @@ -792,22 +799,209 @@ static void test_utf8_to_eci_ucs2be(void) { length = data[i].length != -1 ? data[i].length : (int) strlen(data[i].data); out_length = length; - eci_length = get_eci_length(data[i].eci, (const unsigned char *) data[i].data, length); + eci_length = get_eci_length(eci, (const unsigned char *) data[i].data, length); assert_nonzero(eci_length + 1 <= 1024, "i:%d eci_length %d + 1 > 1024\n", i, eci_length); - ret = utf8_to_eci(data[i].eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); + ret = utf8_to_eci(eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); assert_equal(ret, data[i].ret, "i:%d utf8_to_eci ret %d != %d\n", i, ret, data[i].ret); if (ret == 0) { assert_equal(out_length, data[i].expected_length, "i:%d length %d != %d\n", i, out_length, data[i].expected_length); assert_nonzero(out_length <= eci_length, "i:%d out_length %d > eci_length %d\n", i, out_length, eci_length); + if (data[i].expected) { + ret = memcmp(dest, data[i].expected, data[i].expected_length); + assert_zero(ret, "i:%d memcmp() %d != 0\n", i, ret); + } else { + int j; + for (j = 0; j < length; j++) { + assert_zero(dest[j * 2], "i:%d dest[%d] %d != 0\n", i, j * 2, dest[j * 2]); + assert_equal(dest[j * 2 + 1], data[i].data[j], "i:%d dest[%d] %d != data[%d] %d\n", i, j * 2 + 1, dest[j * 2 + 1], j, data[i].data[j]); + } + } } } -}; +} + +static void test_utf8_to_eci_utf16le(void) { + + struct item { + char *data; + int length; + int ret; + int expected_length; + char *expected; + }; + // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + struct item data[] = { + /* 0*/ { "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 * 2, NULL }, + /* 1*/ { " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 * 2, NULL }, + /* 2*/ { "\302\200\357\277\277", -1, 0, 4, "\200\000\377\377" }, // U+0080 U+FFFF + /* 3*/ { "\357\277\276", -1, 0, 2, "\376\377" }, // U+FFFE (reversed BOM) allowed + /* 4*/ { "\357\273\277", -1, 0, 2, "\377\376" }, // U+FEFF (BOM) allowed + /* 5*/ { "\355\237\277", -1, 0, 2, "\377\327" }, // U+D7FF (ed9fbf) + /* 6*/ { "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // U+D800 (eda080) surrogate half not allowed + /* 7*/ { "\355\277\277", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // U+DFFF (edbfbf) surrogate half not allowed + /* 8*/ { "\356\200\200", -1, 0, 2, "\000\340" }, // U+E000 (ee8080) + /* 9*/ { "\360\220\200\200", -1, 0, 4, "\000\330\000\334" }, // U+10000 maps to surrogate pair + /* 10*/ { "\364\217\277\277", -1, 0, 4, "\377\333\377\337" }, // U+10FFFF maps to surrogate pair + /* 11*/ { "\364\220\200\200", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // Non-Unicode 0x110000 not allowed + }; + int data_size = ARRAY_SIZE(data); + int i, length, ret; + const int eci = 33; + + testStart("test_utf8_to_eci_utf16le"); + + for (i = 0; i < data_size; i++) { + int out_length, eci_length; + char dest[1024]; + + length = data[i].length != -1 ? data[i].length : (int) strlen(data[i].data); + out_length = length; + eci_length = get_eci_length(eci, (const unsigned char *) data[i].data, length); + + assert_nonzero(eci_length + 1 <= 1024, "i:%d eci_length %d + 1 > 1024\n", i, eci_length); + ret = utf8_to_eci(eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); + assert_equal(ret, data[i].ret, "i:%d utf8_to_eci ret %d != %d\n", i, ret, data[i].ret); + if (ret == 0) { + assert_equal(out_length, data[i].expected_length, "i:%d length %d != %d\n", i, out_length, data[i].expected_length); + assert_nonzero(out_length <= eci_length, "i:%d out_length %d > eci_length %d\n", i, out_length, eci_length); + if (data[i].expected) { + ret = memcmp(dest, data[i].expected, data[i].expected_length); + assert_zero(ret, "i:%d memcmp() %d != 0\n", i, ret); + } else { + int j; + for (j = 0; j < length; j++) { + assert_equal(dest[j * 2], data[i].data[j], "i:%d dest[%d] %d != data[%d] %d\n", i, j * 2, dest[j * 2], j, data[i].data[j]); + assert_zero(dest[j * 2 + 1], "i:%d dest[%d] %d != 0\n", i, j * 2 + 1, dest[j * 2 + 1]); + } + } + } + } +} + +static void test_utf8_to_eci_utf32be(void) { + + struct item { + char *data; + int length; + int ret; + int expected_length; + char *expected; + }; + // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + struct item data[] = { + /* 0*/ { "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 * 4, NULL }, + /* 1*/ { " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 * 4, NULL }, + /* 2*/ { "\302\200\357\277\277", -1, 0, 8, "\000\000\000\200\000\000\377\377" }, // U+0080 U+FFFF + /* 3*/ { "\357\277\276", -1, 0, 4, "\000\000\377\376" }, // U+FFFE (reversed BOM) allowed + /* 4*/ { "\357\273\277", -1, 0, 4, "\000\000\376\377" }, // U+FEFF (BOM) allowed + /* 5*/ { "\355\237\277", -1, 0, 4, "\000\000\327\377" }, // U+D7FF (ed9fbf) + /* 6*/ { "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // U+D800 (eda080) surrogate half not allowed + /* 7*/ { "\355\277\277", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // U+DFFF (edbfbf) surrogate half not allowed + /* 8*/ { "\356\200\200", -1, 0, 4, "\000\000\340\000" }, // U+E000 (ee8080) + /* 9*/ { "\360\220\200\200", -1, 0, 4, "\000\001\000\000" }, // U+10000 + /* 10*/ { "\364\217\277\277", -1, 0, 4, "\000\020\377\377" }, // U+10FFFF + /* 11*/ { "\364\220\200\200", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // Non-Unicode 0x110000 not allowed + }; + int data_size = ARRAY_SIZE(data); + int i, length, ret; + const int eci = 34; + + testStart("test_utf8_to_eci_utf32be"); + + for (i = 0; i < data_size; i++) { + int out_length, eci_length; + char dest[1024]; + + length = data[i].length != -1 ? data[i].length : (int) strlen(data[i].data); + out_length = length; + eci_length = get_eci_length(eci, (const unsigned char *) data[i].data, length); + + assert_nonzero(eci_length + 1 <= 1024, "i:%d eci_length %d + 1 > 1024\n", i, eci_length); + ret = utf8_to_eci(eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); + assert_equal(ret, data[i].ret, "i:%d utf8_to_eci ret %d != %d\n", i, ret, data[i].ret); + if (ret == 0) { + assert_equal(out_length, data[i].expected_length, "i:%d length %d != %d\n", i, out_length, data[i].expected_length); + assert_nonzero(out_length <= eci_length, "i:%d out_length %d > eci_length %d\n", i, out_length, eci_length); + if (data[i].expected) { + ret = memcmp(dest, data[i].expected, data[i].expected_length); + assert_zero(ret, "i:%d memcmp() %d != 0\n", i, ret); + } else { + int j; + for (j = 0; j < length; j++) { + assert_zero(dest[j * 4], "i:%d dest[%d] %d != 0\n", i, j * 4, dest[j * 4]); + assert_zero(dest[j * 4 + 1], "i:%d dest[%d] %d != 0\n", i, j * 4 + 1, dest[j * 4 + 1]); + assert_zero(dest[j * 4 + 2], "i:%d dest[%d] %d != 0\n", i, j * 4 + 2, dest[j * 4 + 2]); + assert_equal(dest[j * 4 + 3], data[i].data[j], "i:%d dest[%d] %d != data[%d] %d\n", i, j * 4 + 3, dest[j * 4 + 3], j, data[i].data[j]); + } + } + } + } +} + +static void test_utf8_to_eci_utf32le(void) { + + struct item { + char *data; + int length; + int ret; + int expected_length; + char *expected; + }; + // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + struct item data[] = { + /* 0*/ { "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 * 4, NULL }, + /* 1*/ { " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 * 4, NULL }, + /* 2*/ { "\302\200\357\277\277", -1, 0, 8, "\200\000\000\000\377\377\000\000" }, // U+0080 U+FFFF + /* 3*/ { "\357\277\276", -1, 0, 4, "\376\377\000\000" }, // U+FFFE (reversed BOM) allowed + /* 4*/ { "\357\273\277", -1, 0, 4, "\377\376\000\000" }, // U+FEFF (BOM) allowed + /* 5*/ { "\355\237\277", -1, 0, 4, "\377\327\000\000" }, // U+D7FF (ed9fbf) + /* 6*/ { "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // U+D800 (eda080) surrogate half not allowed + /* 7*/ { "\355\277\277", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // U+DFFF (edbfbf) surrogate half not allowed + /* 8*/ { "\356\200\200", -1, 0, 4, "\000\340\000\000" }, // U+E000 (ee8080) + /* 9*/ { "\360\220\200\200", -1, 0, 4, "\000\000\001\000" }, // U+10000 + /* 10*/ { "\364\217\277\277", -1, 0, 4, "\377\377\020\000" }, // U+10FFFF + /* 11*/ { "\364\220\200\200", -1, ZINT_ERROR_INVALID_DATA, -1, NULL }, // Non-Unicode 0x110000 not allowed + }; + int data_size = ARRAY_SIZE(data); + int i, length, ret; + const int eci = 35; + + testStart("test_utf8_to_eci_utf32le"); + + for (i = 0; i < data_size; i++) { + int out_length, eci_length; + char dest[1024]; + + length = data[i].length != -1 ? data[i].length : (int) strlen(data[i].data); + out_length = length; + eci_length = get_eci_length(eci, (const unsigned char *) data[i].data, length); + + assert_nonzero(eci_length + 1 <= 1024, "i:%d eci_length %d + 1 > 1024\n", i, eci_length); + ret = utf8_to_eci(eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); + assert_equal(ret, data[i].ret, "i:%d utf8_to_eci ret %d != %d\n", i, ret, data[i].ret); + if (ret == 0) { + assert_equal(out_length, data[i].expected_length, "i:%d length %d != %d\n", i, out_length, data[i].expected_length); + assert_nonzero(out_length <= eci_length, "i:%d out_length %d > eci_length %d\n", i, out_length, eci_length); + if (data[i].expected) { + ret = memcmp(dest, data[i].expected, data[i].expected_length); + assert_zero(ret, "i:%d memcmp() %d != 0\n", i, ret); + } else { + int j; + for (j = 0; j < length; j++) { + assert_equal(dest[j * 4], data[i].data[j], "i:%d dest[%d] %d != data[%d] %d\n", i, j * 4, dest[j * 4], j, data[i].data[j]); + assert_zero(dest[j * 4 + 1], "i:%d dest[%d] %d != 0\n", i, j * 4 + 1, dest[j * 4 + 1]); + assert_zero(dest[j * 4 + 2], "i:%d dest[%d] %d != 0\n", i, j * 4 + 2, dest[j * 4 + 2]); + assert_zero(dest[j * 4 + 3], "i:%d dest[%d] %d != 0\n", i, j * 4 + 3, dest[j * 4 + 3]); + } + } + } + } +} static void test_utf8_to_eci_sjis(void) { struct item { - int eci; char *data; int length; int ret; @@ -815,26 +1009,27 @@ static void test_utf8_to_eci_sjis(void) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { 20, "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 }, - /* 1*/ { 20, " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\177", 95, 0, 95 + 1 }, // Backslash goes to 2 byte - /* 2*/ { 20, "~", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for tilde - /* 3*/ { 20, "\302\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+0080 - /* 4*/ { 20, "\302\241", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+00A1 Inverted exclaimation mark - /* 5*/ { 20, "\302\245", -1, 0, 1 }, // U+00A5 Yen goes to backslash - /* 6*/ { 20, "\302\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+00BF Inverted question mark - /* 7*/ { 20, "\303\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+00C0 À - /* 8*/ { 20, "\303\251", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+00E9 é - /* 9*/ { 20, "\312\262", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+03B2 β - /* 10*/ { 20, "\342\272\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+2E80 CJK RADICAL REPEAT - /* 11*/ { 20, "\343\200\200", -1, 0, 2 }, // U+3000 IDEOGRAPHIC SPACE - /* 12*/ { 20, "\343\200\204", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+3004 JAPANESE INDUSTRIAL STANDARD SYMBOL - /* 13*/ { 20, "\343\201\201", -1, 0, 2 }, //U+3041 HIRAGANA LETTER SMALL A - /* 14*/ { 20, "\357\277\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+FFFF - /* 15*/ { 20, "\357\277\276", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+FFFE (reversed BOM) not allowed - /* 16*/ { 20, "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+D800 surrogate not allowed + /* 0*/ { "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 }, + /* 1*/ { " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\177", 95, 0, 95 + 1 }, // Backslash goes to 2 byte + /* 2*/ { "~", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for tilde + /* 3*/ { "\302\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+0080 + /* 4*/ { "\302\241", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+00A1 Inverted exclaimation mark + /* 5*/ { "\302\245", -1, 0, 1 }, // U+00A5 Yen goes to backslash + /* 6*/ { "\302\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+00BF Inverted question mark + /* 7*/ { "\303\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+00C0 À + /* 8*/ { "\303\251", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+00E9 é + /* 9*/ { "\312\262", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+03B2 β + /* 10*/ { "\342\272\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+2E80 CJK RADICAL REPEAT + /* 11*/ { "\343\200\200", -1, 0, 2 }, // U+3000 IDEOGRAPHIC SPACE + /* 12*/ { "\343\200\204", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+3004 JAPANESE INDUSTRIAL STANDARD SYMBOL + /* 13*/ { "\343\201\201", -1, 0, 2 }, //U+3041 HIRAGANA LETTER SMALL A + /* 14*/ { "\357\277\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+FFFF + /* 15*/ { "\357\277\276", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+FFFE (reversed BOM) not allowed + /* 16*/ { "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+D800 surrogate not allowed }; int data_size = ARRAY_SIZE(data); int i, length, ret; + const int eci = 20; testStart("test_utf8_to_eci_sjis"); @@ -844,22 +1039,21 @@ static void test_utf8_to_eci_sjis(void) { length = data[i].length != -1 ? data[i].length : (int) strlen(data[i].data); out_length = length; - eci_length = get_eci_length(data[i].eci, (const unsigned char *) data[i].data, length); + eci_length = get_eci_length(eci, (const unsigned char *) data[i].data, length); assert_nonzero(eci_length + 1 <= 1024, "i:%d eci_length %d + 1 > 1024\n", i, eci_length); - ret = utf8_to_eci(data[i].eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); + ret = utf8_to_eci(eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); assert_equal(ret, data[i].ret, "i:%d utf8_to_eci ret %d != %d\n", i, ret, data[i].ret); if (ret == 0) { assert_equal(out_length, data[i].expected_length, "i:%d length %d != %d\n", i, out_length, data[i].expected_length); assert_nonzero(out_length <= eci_length, "i:%d out_length %d > eci_length %d\n", i, out_length, eci_length); } } -}; +} static void test_utf8_to_eci_big5(void) { struct item { - int eci; char *data; int length; int ret; @@ -867,16 +1061,17 @@ static void test_utf8_to_eci_big5(void) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { 28, "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 }, - /* 1*/ { 28, " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 }, - /* 2*/ { 28, "\302\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+0080 - /* 3*/ { 28, "\343\200\200", -1, 0, 2 }, // U+3000 IDEOGRAPHIC SPACE - /* 4*/ { 28, "\357\277\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+FFFF - /* 5*/ { 28, "\357\277\276", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+FFFE (reversed BOM) not allowed - /* 6*/ { 28, "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+D800 surrogate not allowed + /* 0*/ { "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 }, + /* 1*/ { " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 }, + /* 2*/ { "\302\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+0080 + /* 3*/ { "\343\200\200", -1, 0, 2 }, // U+3000 IDEOGRAPHIC SPACE + /* 4*/ { "\357\277\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+FFFF + /* 5*/ { "\357\277\276", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+FFFE (reversed BOM) not allowed + /* 6*/ { "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+D800 surrogate not allowed }; int data_size = ARRAY_SIZE(data); int i, length, ret; + const int eci = 28; testStart("test_utf8_to_eci_big5"); @@ -886,22 +1081,21 @@ static void test_utf8_to_eci_big5(void) { length = data[i].length != -1 ? data[i].length : (int) strlen(data[i].data); out_length = length; - eci_length = get_eci_length(data[i].eci, (const unsigned char *) data[i].data, length); + eci_length = get_eci_length(eci, (const unsigned char *) data[i].data, length); assert_nonzero(eci_length + 1 <= 1024, "i:%d eci_length %d + 1 > 1024\n", i, eci_length); - ret = utf8_to_eci(data[i].eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); + ret = utf8_to_eci(eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); assert_equal(ret, data[i].ret, "i:%d utf8_to_eci ret %d != %d\n", i, ret, data[i].ret); if (ret == 0) { assert_equal(out_length, data[i].expected_length, "i:%d length %d != %d\n", i, out_length, data[i].expected_length); assert_nonzero(out_length <= eci_length, "i:%d out_length %d > eci_length %d\n", i, out_length, eci_length); } } -}; +} static void test_utf8_to_eci_gb2312(void) { struct item { - int eci; char *data; int length; int ret; @@ -909,16 +1103,17 @@ static void test_utf8_to_eci_gb2312(void) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { 29, "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 }, - /* 1*/ { 29, " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 }, - /* 2*/ { 29, "\302\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+0080 - /* 3*/ { 29, "\343\200\200", -1, 0, 2 }, // U+3000 IDEOGRAPHIC SPACE - /* 4*/ { 29, "\357\277\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+FFFF - /* 5*/ { 29, "\357\277\276", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+FFFE (reversed BOM) not allowed - /* 6*/ { 29, "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+D800 surrogate not allowed + /* 0*/ { "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 }, + /* 1*/ { " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 }, + /* 2*/ { "\302\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+0080 + /* 3*/ { "\343\200\200", -1, 0, 2 }, // U+3000 IDEOGRAPHIC SPACE + /* 4*/ { "\357\277\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+FFFF + /* 5*/ { "\357\277\276", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+FFFE (reversed BOM) not allowed + /* 6*/ { "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+D800 surrogate not allowed }; int data_size = ARRAY_SIZE(data); int i, length, ret; + const int eci = 29; testStart("test_utf8_to_eci_gb2312"); @@ -928,22 +1123,21 @@ static void test_utf8_to_eci_gb2312(void) { length = data[i].length != -1 ? data[i].length : (int) strlen(data[i].data); out_length = length; - eci_length = get_eci_length(data[i].eci, (const unsigned char *) data[i].data, length); + eci_length = get_eci_length(eci, (const unsigned char *) data[i].data, length); assert_nonzero(eci_length + 1 <= 1024, "i:%d eci_length %d + 1 > 1024\n", i, eci_length); - ret = utf8_to_eci(data[i].eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); + ret = utf8_to_eci(eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); assert_equal(ret, data[i].ret, "i:%d utf8_to_eci ret %d != %d\n", i, ret, data[i].ret); if (ret == 0) { assert_equal(out_length, data[i].expected_length, "i:%d length %d != %d\n", i, out_length, data[i].expected_length); assert_nonzero(out_length <= eci_length, "i:%d out_length %d > eci_length %d\n", i, out_length, eci_length); } } -}; +} static void test_utf8_to_eci_euc_kr(void) { struct item { - int eci; char *data; int length; int ret; @@ -951,16 +1145,17 @@ static void test_utf8_to_eci_euc_kr(void) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { 30, "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 }, - /* 1*/ { 30, " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 }, - /* 2*/ { 30, "\302\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+0080 - /* 3*/ { 30, "\343\200\200", -1, 0, 2 }, // U+3000 IDEOGRAPHIC SPACE - /* 4*/ { 30, "\357\277\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+FFFF - /* 5*/ { 30, "\357\277\276", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+FFFE (reversed BOM) not allowed - /* 6*/ { 30, "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+D800 surrogate not allowed + /* 0*/ { "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", 32, 0, 32 }, + /* 1*/ { " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177", 96, 0, 96 }, + /* 2*/ { "\302\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+0080 + /* 3*/ { "\343\200\200", -1, 0, 2 }, // U+3000 IDEOGRAPHIC SPACE + /* 4*/ { "\357\277\277", -1, ZINT_ERROR_INVALID_DATA, -1 }, // No mapping for U+FFFF + /* 5*/ { "\357\277\276", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+FFFE (reversed BOM) not allowed + /* 6*/ { "\355\240\200", -1, ZINT_ERROR_INVALID_DATA, -1 }, // U+D800 surrogate not allowed }; int data_size = ARRAY_SIZE(data); int i, length, ret; + const int eci = 30; testStart("test_utf8_to_eci_euc_kr"); @@ -970,17 +1165,17 @@ static void test_utf8_to_eci_euc_kr(void) { length = data[i].length != -1 ? data[i].length : (int) strlen(data[i].data); out_length = length; - eci_length = get_eci_length(data[i].eci, (const unsigned char *) data[i].data, length); + eci_length = get_eci_length(eci, (const unsigned char *) data[i].data, length); assert_nonzero(eci_length + 1 <= 1024, "i:%d eci_length %d + 1 > 1024\n", i, eci_length); - ret = utf8_to_eci(data[i].eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); + ret = utf8_to_eci(eci, (const unsigned char *) data[i].data, (unsigned char *) dest, &out_length); assert_equal(ret, data[i].ret, "i:%d utf8_to_eci ret %d != %d\n", i, ret, data[i].ret); if (ret == 0) { assert_equal(out_length, data[i].expected_length, "i:%d length %d != %d\n", i, out_length, data[i].expected_length); assert_nonzero(out_length <= eci_length, "i:%d out_length %d > eci_length %d\n", i, out_length, eci_length); } } -}; +} static void test_get_best_eci(int index) { @@ -1026,7 +1221,10 @@ int main(int argc, char *argv[]) { { "test_reduced_charset_input", test_reduced_charset_input, 1, 0, 1 }, { "test_utf8_to_eci_sb", test_utf8_to_eci_sb, 1, 0, 0 }, { "test_utf8_to_eci_ascii", test_utf8_to_eci_ascii, 0, 0, 0 }, - { "test_utf8_to_eci_ucs2be", test_utf8_to_eci_ucs2be, 0, 0, 0 }, + { "test_utf8_to_eci_utf16be", test_utf8_to_eci_utf16be, 0, 0, 0 }, + { "test_utf8_to_eci_utf16le", test_utf8_to_eci_utf16le, 0, 0, 0 }, + { "test_utf8_to_eci_utf32be", test_utf8_to_eci_utf32be, 0, 0, 0 }, + { "test_utf8_to_eci_utf32le", test_utf8_to_eci_utf32le, 0, 0, 0 }, { "test_utf8_to_eci_sjis", test_utf8_to_eci_sjis, 0, 0, 0 }, { "test_utf8_to_eci_big5", test_utf8_to_eci_big5, 0, 0, 0 }, { "test_utf8_to_eci_gb2312", test_utf8_to_eci_gb2312, 0, 0, 0 }, @@ -1040,3 +1238,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et norl : */ diff --git a/backend/tests/test_gb18030.c b/backend/tests/test_gb18030.c index 4c3dcb33..15c93fe5 100644 --- a/backend/tests/test_gb18030.c +++ b/backend/tests/test_gb18030.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" #include "test_gb18030_tab.h" @@ -388,6 +387,70 @@ static void test_gb18030_cpy(int index) { testFinish(); } +/* For testing GBK, to exclude GB 18030 extensions */ +STATIC_UNLESS_ZINT_TEST int gb18030ext_wctomb(unsigned int *r, const unsigned int wc); +STATIC_UNLESS_ZINT_TEST int gb18030uni_wctomb(unsigned int *r1, unsigned int *r2, const unsigned int wc); + +/* Control for GBK */ +static int gbk_wctomb_zint2(unsigned int *r, unsigned int wc) { + unsigned int c; + int tab_length, start_i, end_i; + int i; + unsigned int r1, r2; + + if (gb18030ext_wctomb(&r1, wc)) { + return 0; + } + if (wc >= 0xe000 && wc <= 0xe864) { + return 0; + } + if (gb18030uni_wctomb(&r1, &r2, wc)) { + return 0; + } + + tab_length = ARRAY_SIZE(test_gb18030_tab); + start_i = test_gb18030_tab_ind[wc >> 10]; + end_i = start_i + 0x800 > tab_length ? tab_length : start_i + 0x800; + for (i = start_i; i < end_i; i += 2) { + if (test_gb18030_tab[i + 1] == wc) { + c = test_gb18030_tab[i]; + if (c <= 0xFFFF) { + *r = c; + return c <= 0xFF ? 1 : 2; + } + return 0; + } + } + return 0; +} + +static void test_gbk_wctomb_zint(void) { + + int ret, ret2; + unsigned int val, val2; + unsigned int i; + + testStart("test_gbk_wctomb_zint"); + + for (i = 0; i < 0xFFFE; i++) { + if (i < 0x80) { // ASCII is straight through and not dealt with by gbk_wctomb_zint() + continue; + } + if (i >= 0xD800 && i <= 0xDFFF) { // UTF-16 surrogates + continue; + } + val = val2 = 0; + ret = gbk_wctomb_zint(&val, i); + ret2 = gbk_wctomb_zint2(&val2, i); + assert_equal(ret, ret2, "i:%d 0x%04X ret %d != ret2 %d, val 0x%04X, val2 0x%04X\n", (int) i, i, ret, ret2, val, val2); + if (ret2) { + assert_equal(val, val2, "i:%d 0x%04X val 0x%04X != val2 0x%04X\n", (int) i, i, val, val2); + } + } + + testFinish(); +} + int main(int argc, char *argv[]) { testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */ @@ -395,6 +458,7 @@ int main(int argc, char *argv[]) { { "test_gb18030_utf8", test_gb18030_utf8, 1, 0, 0 }, { "test_gb18030_utf8_to_eci", test_gb18030_utf8_to_eci, 1, 0, 0 }, { "test_gb18030_cpy", test_gb18030_cpy, 1, 0, 0 }, + { "test_gbk_wctomb_zint", test_gbk_wctomb_zint, 0, 0, 0 }, }; testRun(argc, argv, funcs, ARRAY_SIZE(funcs)); @@ -403,3 +467,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_gridmtx.c b/backend/tests/test_gridmtx.c index df4a0f67..6cbffd9c 100644 --- a/backend/tests/test_gridmtx.c +++ b/backend/tests/test_gridmtx.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019-2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et norl : */ #include "testcommon.h" @@ -196,7 +195,7 @@ static void test_input(int index, int generate, int debug) { /* 5*/ { DATA_MODE, 0, -1, -1, { 0, 0, "" }, "é", 0, 0, "30 03 43 54 40", "B2 (UTF-8)" }, /* 6*/ { DATA_MODE, 0, -1, ZINT_FULL_MULTIBYTE, { 0, 0, "" }, "é", 0, 0, "0A 51 1F 78 00", "H1 (UTF-8) (full multibyte)" }, /* 7*/ { DATA_MODE, 0, -1, -1, { 0, 0, "" }, "\351", 0, 0, "30 01 69 00", "B1 (ISO 8859-1) (0xE9)" }, - /* 8*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "β", 0, 0, "08 40 2F 78 00", "H1 (GB 2312)" }, + /* 8*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "β", ZINT_WARN_NONCOMPLIANT, 0, "Warning 08 40 2F 78 00", "H1 (GB 2312)" }, /* 9*/ { UNICODE_MODE, 9, -1, -1, { 0, 0, "" }, "β", 0, 9, "60 04 58 00 71 00", "ECI-9 B1 (ISO 8859-7)" }, /* 10*/ { UNICODE_MODE, 29, -1, -1, { 0, 0, "" }, "β", 0, 29, "60 0E 44 20 17 7C 00", "ECI-29 H1 (GB 2312)" }, /* 11*/ { UNICODE_MODE, 26, -1, -1, { 0, 0, "" }, "β", 0, 26, "60 0D 18 01 67 2C 40", "ECI-26 H1 (UTF-8)" }, @@ -205,7 +204,7 @@ static void test_input(int index, int generate, int debug) { /* 14*/ { DATA_MODE, 0, -1, ZINT_FULL_MULTIBYTE, { 0, 0, "" }, "β", 0, 0, "0B 56 2F 78 00", "H1 (UTF-8) (full multibyte)" }, /* 15*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ÿ", 0, 0, "30 01 7F 00", "B1 (ISO 8859-1)" }, /* 16*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ÿÿÿ", 0, 0, "30 05 7F 7F 7F 60", "B3 (ISO 8859-1)" }, - /* 17*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "㈩一", 0, 0, "08 15 68 0E 7F 70 00", "H2 (GB 2312)" }, + /* 17*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "㈩一", ZINT_WARN_NONCOMPLIANT, 0, "Warning 08 15 68 0E 7F 70 00", "H2 (GB 2312)" }, /* 18*/ { UNICODE_MODE, 29, -1, -1, { 0, 0, "" }, "㈩一", 0, 29, "60 0E 44 0A 74 07 3F 78 00", "ECI-29 H2 (GB 2312)" }, /* 19*/ { DATA_MODE, 0, -1, -1, { 0, 0, "" }, "\177\177", 0, 0, "30 02 7F 3F 40", "B2 (ASCII)" }, /* 20*/ { DATA_MODE, 0, -1, -1, { 0, 0, "" }, "\177\177\177", 0, 0, "30 04 7F 3F 5F 60", "B3 (ASCII)" }, @@ -227,27 +226,27 @@ static void test_input(int index, int generate, int debug) { /* 36*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDE\011F", 0, 0, "20 01 08 32 3E 49 17 30", "U7 (ASCII)" }, /* 37*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1 1234ABCD12.2abcd-12", 0, 0, "13 7A 23 41 2A 3F 68 01 08 3E 4F 66 1E 5F 70 00 44 1F 2F 6E 0F 0F 74", "N6 U4 N4 L4 N3 (ASCII)" }, /* 38*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1 123ABCDE12.2abcd-12", 0, 0, "28 1F 40 42 06 28 59 43 27 01 05 7D 56 42 49 16 34 7F 6D 30 08 2F 60", "M21 (ASCII)" }, - /* 39*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "国外通信教材 Matlab6.5", 0, 0, "09 63 27 20 4E 24 1F 05 21 58 22 13 7E 1E 4C 78 09 56 00 3D 3F 4A 45 3F 50", "H6 U2 L5 N3 (GB 2312) (Same as D.2 example)" }, + /* 39*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "国外通信教材 Matlab6.5", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 63 27 20 4E 24 1F 05 21 58 22 13 7E 1E 4C 78 09 56 00 3D 3F 4A 45 3F 50", "H6 U2 L5 N3 (GB 2312) (Same as D.2 example)" }, /* 40*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT", 0, 0, "20 00 4F 30", "U3 (ASCII)" }, /* 41*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "aat", 0, 0, "18 00 4F 30", "L3 (ASCII)" }, /* 42*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556", 0, 0, "20 00 4F 58 7F 65 47 7A", "U3 N4 (ASCII) (note same bit count as M7)" }, /* 43*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 ", 0, 0, "29 22 4E 42 0A 14 37 6F 60", "M8 (ASCII)" }, - /* 44*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 电", 0, 0, "29 22 4E 42 0A 14 37 6F 62 2C 1F 7E 00", "M8 H1 (GB 2312)" }, + /* 44*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 电", ZINT_WARN_NONCOMPLIANT, 0, "Warning 29 22 4E 42 0A 14 37 6F 62 2C 1F 7E 00", "M8 H1 (GB 2312)" }, /* 45*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, " 200", 0, 0, "11 7A 06 23 7D 00", "N4 (ASCII)" }, - /* 46*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, " 200mA至", 0, 0, "2F 60 40 00 60 2B 78 63 41 7F 40", "M6 H1 (GB 2312)" }, + /* 46*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, " 200mA至", ZINT_WARN_NONCOMPLIANT, 0, "Warning 2F 60 40 00 60 2B 78 63 41 7F 40", "M6 H1 (GB 2312)" }, /* 47*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "2A tel:86 019 82512738", 0, 0, "28 22 5F 4F 29 48 5F 6D 7E 6F 55 57 1F 28 63 0F 5A 11 64 0F 74", "M2 L5(with control) N15 (ASCII)" }, - /* 48*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "至2A tel:86 019 82512738", 0, 0, "30 07 56 60 4C 48 13 6A 32 17 7B 3F 5B 75 35 67 6A 18 63 76 44 39 03 7D 00", "B4 L5(with control) N15 (GB 2312)" }, - /* 49*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738", 0, 0, "(62) 29 22 22 1C 4E 41 42 7E 0A 40 14 00 37 7E 6F 00 62 7E 2C 00 1C 7E 4B 00 41 7E 18 00", "M8 H11 M6 B4 L5(with control) N15 (GB 2312) (*NOT SAME* as D3 example Figure D.1, M8 H11 M6 H1 M3 L4(with control) N15, which uses a few more bits)" }, + /* 48*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "至2A tel:86 019 82512738", ZINT_WARN_NONCOMPLIANT, 0, "Warning 30 07 56 60 4C 48 13 6A 32 17 7B 3F 5B 75 35 67 6A 18 63 76 44 39 03 7D 00", "B4 L5(with control) N15 (GB 2312)" }, + /* 49*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738", ZINT_WARN_NONCOMPLIANT, 0, "Warning (62) 29 22 22 1C 4E 41 42 7E 0A 40 14 00 37 7E 6F 00 62 7E 2C 00 1C 7E 4B 00 41 7E 18 00", "M8 H11 M6 B4 L5(with control) N15 (GB 2312) (*NOT SAME* as D3 example Figure D.1, M8 H11 M6 H1 M3 L4(with control) N15, which uses a few more bits)" }, /* 50*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::", 0, 0, "(588) 37 68 68 68 68 68 74 7E 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B512 (ASCII)" }, /* 51*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\177", 0, 0, "(591) 37 68 68 68 68 68 74 7E 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B513 (ASCII)" }, - /* 52*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::至", 0, 0, "(591) 37 68 68 68 68 68 74 7C 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B511 H1 (GB 2312)" }, - /* 53*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::至:", 0, 0, "(592) 37 68 68 68 68 68 74 7E 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B513 (GB 2312)" }, - /* 54*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电123456", 0, 0, "09 30 72 61 7F 70 41 76 72 1F 68", "H2 (GB 2312) N6" }, - /* 55*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电abcdef", 0, 0, "09 30 72 61 7F 71 00 08 43 10 5D 40", "H2 (GB 2312) L6" }, - /* 56*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电\011\011\011", 0, 0, "09 30 72 61 65 43 4B 07 16 0F 7F 14 02 04 42 21 10", "H5 (GB 2312) B3" }, - /* 57*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1234567电电", 0, 0, "14 1E 6E 22 5E 3F 59 30 72 61 7F 70 00", "N7 H2 (GB 2312)" }, + /* 52*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::至", ZINT_WARN_NONCOMPLIANT, 0, "Warning (591) 37 68 68 68 68 68 74 7C 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B511 H1 (GB 2312)" }, + /* 53*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::至:", ZINT_WARN_NONCOMPLIANT, 0, "Warning (592) 37 68 68 68 68 68 74 7E 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B513 (GB 2312)" }, + /* 54*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电123456", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 7F 70 41 76 72 1F 68", "H2 (GB 2312) N6" }, + /* 55*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电abcdef", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 7F 71 00 08 43 10 5D 40", "H2 (GB 2312) L6" }, + /* 56*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电\011\011\011", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 65 43 4B 07 16 0F 7F 14 02 04 42 21 10", "H5 (GB 2312) B3" }, + /* 57*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1234567电电", ZINT_WARN_NONCOMPLIANT, 0, "Warning 14 1E 6E 22 5E 3F 59 30 72 61 7F 70 00", "N7 H2 (GB 2312)" }, /* 58*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "12345678mA 2", 0, 0, "12 1E 6E 23 06 3F 76 02 5F 02 7E 00", "N8 M4" }, - /* 59*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDEFG电电", 0, 0, "20 01 08 32 0A 37 05 43 4B 07 7F 40", "U7 H2 (GB 2312)" }, + /* 59*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDEFG电电", ZINT_WARN_NONCOMPLIANT, 0, "Warning 20 01 08 32 0A 37 05 43 4B 07 7F 40", "U7 H2 (GB 2312)" }, /* 60*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDEFGHIJ8mA 2", 0, 0, "20 01 08 32 0A 31 68 27 70 46 02 5F 02 7E 00", "U10 M5" }, /* 61*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDEFGHIJ\011\011\011\011", 0, 0, "20 01 08 32 0A 31 68 27 78 03 04 42 21 10 48 00", "U10 B4" }, /* 62*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "8mA B123456789", 0, 0, "29 0C 05 3E 17 7C 40 7B 39 0C 2B 7E 40", "M5 N9" }, @@ -255,8 +254,8 @@ static void test_input(int index, int generate, int debug) { /* 64*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "\011\011\011\011123456", 0, 0, "30 06 09 04 42 21 12 03 6D 64 3F 50", "B4 N6" }, /* 65*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "\011\011\011\011ABCDEF", 0, 0, "30 06 09 04 42 21 14 00 11 06 21 3B", "B4 U6" }, /* 66*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "\011\011\011\0118mA 2", 0, 0, "30 06 09 04 42 21 15 11 40 57 60 5F 40", "B4 M5" }, - /* 67*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电\015\012", 0, 0, "09 30 72 61 65 43 4B 07 16 0F 73 03 7E 00", "H7 (GB 2312)" }, - /* 68*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电12", 0, 0, "09 30 72 61 65 43 4B 07 16 0F 7B 37 7E 00", "H7 (GB 2312)" }, + /* 67*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电\015\012", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 65 43 4B 07 16 0F 73 03 7E 00", "H7 (GB 2312)" }, + /* 68*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电12", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 65 43 4B 07 16 0F 7B 37 7E 00", "H7 (GB 2312)" }, /* 69*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1234567.8\015\012123456", 0, 0, "10 1E 6E 23 79 30 67 77 0F 37 11 7E 40", "N17" }, /* 70*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "˘", ZINT_WARN_USES_ECI, 4, "Warning 60 02 18 00 51 00", "ECI-4 B1 (ISO 8859-2)" }, /* 71*/ { UNICODE_MODE, 4, -1, -1, { 0, 0, "" }, "˘", 0, 4, "60 02 18 00 51 00", "ECI-4 B1 (ISO 8859-2)" }, @@ -266,11 +265,11 @@ static void test_input(int index, int generate, int debug) { /* 75*/ { UNICODE_MODE, 7, -1, -1, { 0, 0, "" }, "Ж", 0, 7, "60 03 58 00 5B 00", "ECI-7 B1 (ISO 8859-5)" }, /* 76*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "Ș", ZINT_WARN_USES_ECI, 18, "Warning 60 09 18 00 55 00", "ECI-18 B1 (ISO 8859-16)" }, /* 77*/ { UNICODE_MODE, 18, -1, -1, { 0, 0, "" }, "Ș", 0, 18, "60 09 18 00 55 00", "ECI-18 B1 (ISO 8859-16)" }, - /* 78*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "テ", 0, 0, "08 34 6F 78 00", "H1 (GB 2312)" }, + /* 78*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "テ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 08 34 6F 78 00", "H1 (GB 2312)" }, /* 79*/ { UNICODE_MODE, 20, -1, -1, { 0, 0, "" }, "テ", 0, 20, "60 0A 18 01 41 59 20", "ECI-20 B2 (SHIFT JIS)" }, /* 80*/ { UNICODE_MODE, 20, -1, -1, { 0, 0, "" }, "テテ", 0, 20, "60 0A 18 03 41 59 30 36 28 00", "ECI-20 B4 (SHIFT JIS)" }, /* 81*/ { UNICODE_MODE, 20, -1, -1, { 0, 0, "" }, "\\\\", 0, 20, "60 0A 18 03 40 57 70 15 78 00", "ECI-20 B4 (SHIFT JIS)" }, - /* 82*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "…", 0, 0, "08 01 5F 78 00", "H1 (GB 2312)" }, + /* 82*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "…", ZINT_WARN_NONCOMPLIANT, 0, "Warning 08 01 5F 78 00", "H1 (GB 2312)" }, /* 83*/ { UNICODE_MODE, 21, -1, -1, { 0, 0, "" }, "…", 0, 21, "60 0A 58 00 42 40", "ECI-21 B1 (Win 1250)" }, /* 84*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "Ґ", ZINT_WARN_USES_ECI, 22, "Warning 60 0B 18 00 52 40", "ECI-22 B1 (Win 1251)" }, /* 85*/ { UNICODE_MODE, 22, -1, -1, { 0, 0, "" }, "Ґ", 0, 22, "60 0B 18 00 52 40", "ECI-22 B1 (Win 1251)" }, @@ -285,7 +284,7 @@ static void test_input(int index, int generate, int debug) { /* 94*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "龘", ZINT_WARN_USES_ECI, 26, "Warning 60 0D 18 02 74 6F 53 00", "ECI-26 B3 (UTF-8)" }, /* 95*/ { UNICODE_MODE, 28, -1, -1, { 0, 0, "" }, "龘", 0, 28, "60 0E 18 01 7C 75 20", "ECI-28 B2 (Big5)" }, /* 96*/ { UNICODE_MODE, 28, -1, -1, { 0, 0, "" }, "龘龘", 0, 28, "60 0E 18 03 7C 75 3F 1D 28 00", "ECI-28 B4 (Big5)" }, - /* 97*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "齄", 0, 0, "0F 4B 6F 78 00", "H1 (GB 2312)" }, + /* 97*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "齄", ZINT_WARN_NONCOMPLIANT, 0, "Warning 0F 4B 6F 78 00", "H1 (GB 2312)" }, /* 98*/ { UNICODE_MODE, 29, -1, -1, { 0, 0, "" }, "齄", 0, 29, "60 0E 47 65 77 7C 00", "ECI-29 H1 (GB 2312)" }, /* 99*/ { UNICODE_MODE, 29, -1, -1, { 0, 0, "" }, "齄齄", 0, 29, "60 0E 47 65 77 4B 6F 78 00", "ECI-29 H2 (GB 2312)" }, /*100*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "가", ZINT_WARN_USES_ECI, 26, "Warning 60 0D 18 02 75 2C 10 00", "ECI-26 B3 (UTF-8)" }, @@ -416,7 +415,7 @@ static void test_encode(int index, int generate, int debug) { "101111010010100001010010110111" "111111000000111111000000111111" }, - /* 2*/ { "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738", UNICODE_MODE, 3, 3, 0, 42, 42, "AIMD014 Figure D.1 **NOT SAME** different encodation, see test_input dataset", + /* 2*/ { "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738", UNICODE_MODE, 3, 3, ZINT_WARN_NONCOMPLIANT, 42, 42, "AIMD014 Figure D.1 **NOT SAME** different encodation, see test_input dataset", "111111000000111111000000111111000000111111" "101101001100101111001010101011001100101101" "110001011010110101010000100011000000100001" @@ -603,3 +602,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et norl : */ diff --git a/backend/tests/test_hanxin.c b/backend/tests/test_hanxin.c index 571addb5..33537263 100644 --- a/backend/tests/test_hanxin.c +++ b/backend/tests/test_hanxin.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et norl : */ #include "testcommon.h" @@ -46,22 +45,22 @@ static void test_large(int index, int debug) { struct item data[] = { /* 0*/ { -1, -1, "1", 7827, 0, 189, 189 }, /* 1*/ { -1, -1, "1", 7828, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 2*/ { -1, -1, "A", 4349, 0, 189, 189 }, // TODO: should be 4350 according to spec, investigate - /* 3*/ { -1, -1, "A", 4350, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 4*/ { -1, -1, "\200", 3260, 0, 189, 189 }, // TODO: should be 3261 according to spec, investigate - /* 5*/ { -1, -1, "\200", 3261, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 6*/ { -1, 1, "1", 42, 0, 23, 23 }, - /* 7*/ { -1, 1, "1", 43, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 8*/ { -1, 1, "A", 25, 0, 23, 23 }, - /* 9*/ { -1, 1, "A", 26, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 10*/ { -1, 1, "\200", 17, 0, 23, 23 }, - /* 11*/ { -1, 1, "\200", 18, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 12*/ { 2, 1, "A", 19, 0, 23, 23 }, - /* 13*/ { 2, 1, "A", 20, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 14*/ { 3, 1, "A", 14, 0, 23, 23 }, - /* 15*/ { 3, 1, "A", 15, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 16*/ { 4, 1, "A", 9, 0, 23, 23 }, - /* 17*/ { 4, 1, "A", 10, ZINT_ERROR_TOO_LONG, -1, -1 }, + /* 2*/ { -1, -1, "A", 4350, 0, 189, 189 }, + /* 3*/ { -1, -1, "A", 4351, ZINT_ERROR_TOO_LONG, -1, -1 }, + /* 4*/ { -1, -1, "\200", 3261, 0, 189, 189 }, + /* 5*/ { -1, -1, "\200", 3262, ZINT_ERROR_TOO_LONG, -1, -1 }, + /* 6*/ { -1, 1, "1", 45, 0, 23, 23 }, + /* 7*/ { -1, 1, "1", 46, ZINT_ERROR_TOO_LONG, -1, -1 }, + /* 8*/ { -1, 1, "A", 26, 0, 23, 23 }, + /* 9*/ { -1, 1, "A", 27, ZINT_ERROR_TOO_LONG, -1, -1 }, + /* 10*/ { -1, 1, "\200", 18, 0, 23, 23 }, + /* 11*/ { -1, 1, "\200", 19, ZINT_ERROR_TOO_LONG, -1, -1 }, + /* 12*/ { 2, 1, "A", 21, 0, 23, 23 }, + /* 13*/ { 2, 1, "A", 22, ZINT_ERROR_TOO_LONG, -1, -1 }, + /* 14*/ { 3, 1, "A", 15, 0, 23, 23 }, + /* 15*/ { 3, 1, "A", 16, ZINT_ERROR_TOO_LONG, -1, -1 }, + /* 16*/ { 4, 1, "A", 10, 0, 23, 23 }, + /* 17*/ { 4, 1, "A", 11, ZINT_ERROR_TOO_LONG, -1, -1 }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -114,13 +113,13 @@ static void test_options(int index, int debug) { /* 2*/ { -1, 2, "12345", 0, 0, 25 }, /* 3*/ { -1, 85, "12345", 0, 0, 23 }, // Version > max version 85 so ignored /* 4*/ { -1, 84, "12345", 0, 0, 189 }, - /* 5*/ { 1, 1, "1234567890123456789012345678901234567890123", ZINT_ERROR_TOO_LONG, -1, -1 }, + /* 5*/ { 1, 1, "1234567890123456789012345678901234567890123456", ZINT_ERROR_TOO_LONG, -1, -1 }, /* 6*/ { 4, 1, "1234567890123456", ZINT_ERROR_TOO_LONG, -1, -1 }, /* 7*/ { 4, 2, "12345678901234567", 0, 0, 25 }, /* 8*/ { 4, -1, "12345678901234567", 0, 0, 25 }, // Version auto-set to 2 /* 9*/ { -1, -1, "12345678901234567", 0, 0, 23 }, // Version auto-set to 1, ECC auto-set to 3 /* 10*/ { 5, -1, "12345678901234567", 0, 0, 23 }, // ECC > max ECC 4 so ignored and auto-settings version 1, ECC 3 used - /* 11*/ { -1, -1, "1234567890123456789012345678901234567890123", 0, 0, 25 }, // Version auto-set to 2, ECC auto-set to 2 + /* 11*/ { -1, -1, "1234567890123456789012345678901234567890123456", 0, 0, 25 }, // Version auto-set to 2, ECC auto-set to 2 }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -178,85 +177,89 @@ static void test_input(int index, int generate, int debug) { struct item data[] = { /* 0*/ { UNICODE_MODE, 0, -1, "é", -1, 0, 0, "30 00 F4 80 00 00 00 00 00", "B1 (ISO 8859-1)" }, /* 1*/ { UNICODE_MODE, 3, -1, "é", -1, 0, 3, "80 33 00 0F 48 00 00 00 00", "ECI-3 B1 (ISO 8859-1)" }, - /* 2*/ { UNICODE_MODE, 29, -1, "é", -1, 0, 29, "81 D4 FC FF FF 00 00 00 00", "ECI-29 H(1)1 (GB 18030) (Region One)" }, - /* 3*/ { UNICODE_MODE, 26, -1, "é", -1, 0, 26, "81 A3 00 16 1D 48 00 00 00", "ECI-26 B2 (UTF-8)" }, - /* 4*/ { UNICODE_MODE, 26, ZINT_FULL_MULTIBYTE, "é", -1, 0, 26, "81 A4 70 2F FF 00 00 00 00", "ECI-26 H(1)1 (Region One) (UTF-8) (full multibyte)" }, - /* 5*/ { DATA_MODE, 0, -1, "é", -1, 0, 0, "30 01 61 D4 80 00 00 00 00", "B2 (UTF-8)" }, - /* 6*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "é", -1, 0, 0, "47 02 FF F0 00 00 00 00 00", "H(1)1 (UTF-8) (Region One) (full multibyte)" }, - /* 7*/ { DATA_MODE, 0, -1, "\351", -1, 0, 0, "30 00 F4 80 00 00 00 00 00", "B1 (ISO 8859-1) (0xE9)" }, - /* 8*/ { UNICODE_MODE, 0, -1, "β", -1, 0, 0, "30 01 53 61 00 00 00 00 00", "B2 (GB 18030) (2-byte Region)" }, - /* 9*/ { UNICODE_MODE, 9, -1, "β", -1, 0, 9, "80 93 00 0F 10 00 00 00 00", "ECI-9 B1 (ISO 8859-7)" }, - /* 10*/ { UNICODE_MODE, 29, -1, "β", -1, 0, 29, "81 D3 00 15 36 10 00 00 00", "ECI-29 B2 (GB 18030) (2-byte Region)" }, - /* 11*/ { UNICODE_MODE, 26, -1, "β", -1, 0, 26, "81 A3 00 16 75 90 00 00 00", "ECI-26 B2 (UTF-8)" }, - /* 12*/ { UNICODE_MODE, 26, ZINT_FULL_MULTIBYTE, "β", -1, 0, 26, "81 A4 B1 5F FF 00 00 00 00", "ECI-26 B2 (UTF-8) (full multibyte)" }, - /* 13*/ { DATA_MODE, 0, -1, "β", -1, 0, 0, "30 01 67 59 00 00 00 00 00", "B2 (UTF-8)" }, - /* 14*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "β", -1, 0, 0, "4B 15 FF F0 00 00 00 00 00", "H(1)1 (UTF-8) (Region One) (full multibyte)" }, - /* 15*/ { UNICODE_MODE, 0, -1, "ÿ", -1, 0, 0, "30 00 FF 80 00 00 00 00 00", "B1 (ISO 8859-1)" }, - /* 16*/ { UNICODE_MODE, 0, -1, "ÿÿÿ", -1, 0, 0, "30 01 FF FF FF 80 00 00 00", "B3 (ISO 8859-1)" }, - /* 17*/ { UNICODE_MODE, 0, -1, "\302\200", -1, 0, 0, "70 00 00 00 00 00 00 00 00", "H(f)1 (GB 18030) (4-byte Region) (not DATA_MODE so GB 18030 mapping)" }, - /* 18*/ { UNICODE_MODE, 0, ZINT_FULL_MULTIBYTE, "\302\200", -1, 0, 0, "70 00 00 00 00 00 00 00 00", "H(f)1 (GB 18030) (4-byte Region)" }, - /* 19*/ { DATA_MODE, 0, 0, "\302\200", -1, 0, 0, "30 01 61 40 00 00 00 00 00", "B2 (UTF-8)" }, - /* 20*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "\302\200", -1, 0, 0, "30 01 61 40 00 00 00 00 00", "B2 (UTF-8) (full multibyte)" }, - /* 21*/ { UNICODE_MODE, 0, -1, "\302\200�", -1, 0, 0, "70 00 00 38 26 7E 40 00 00", "H(f)2 (GB 18030) (both 4-byte Region) (not DATA_MODE so GB 18030 mapping)" }, - /* 22*/ { UNICODE_MODE, 0, ZINT_FULL_MULTIBYTE, "\302\200�", -1, 0, 0, "70 00 00 38 26 7E 40 00 00", "H(f)2 (GB 18030) (both 4-byte Region)" }, - /* 23*/ { UNICODE_MODE, 0, -1, "啊亍齄丂\302\200", -1, 0, 0, "64 68 50 3C AC 28 80 00 FF FE E0 00 00 00 00 00 00", "H(d)4 H(f)1 (GB 18030)" }, - /* 24*/ { DATA_MODE, 0, -1, "\177\177", -1, 0, 0, "2F BD F7 F0 00 00 00 00 00", "T2 (ASCII)" }, - /* 25*/ { DATA_MODE, 0, -1, "\177\177\177", -1, 0, 0, "2F BD F7 DF C0 00 00 00 00", "T3 (ASCII)" }, - /* 26*/ { UNICODE_MODE, 0, -1, "123", -1, 0, 0, "11 EF FF 00 00 00 00 00 00", "N3 (ASCII)" }, - /* 27*/ { UNICODE_MODE, 0, -1, "12345", -1, 0, 0, "11 EC 2D FF 80 00 00 00 00", "N5 (ASCII)" }, - /* 28*/ { UNICODE_MODE, 0, -1, "Aa%$Bb9", -1, 0, 0, "22 A4 FA 18 3E 2E 52 7F 00", "T7 (ASCII)" }, - /* 29*/ { UNICODE_MODE, 0, -1, "Summer Palace Ticket for 6 June 2015 13:00;2015年6月6日夜01時00分PM頤和園のチケット;2015년6월6일13시오후여름궁전티켓.2015年6月6号下午13:00的颐和园门票;", -1, 0, 0, "(189) 27 38 C3 0A 35 F9 CF 99 92 F9 26 A3 E7 3E 76 C9 AE A3 7F CC 08 04 0C CD EE 44 06 C4", "T20 B64 N4 H(f)1 T1 H(f)1 T1 H(f)1 T2 H(f)9 B35 (GB 18030)" }, - /* 30*/ { DATA_MODE, 0, -1, "Summer Palace Ticket for 6 June 2015 13:00;2015年6月6日夜01時00分PM頤和園のチケット;2015년6월6일13시오후여름궁전티켓.2015年6月6号下午13:00的颐和园门票;", -1, 0, 0, "(209) 27 38 C3 0A 35 F9 CF 99 92 F9 26 A3 E7 3E 76 C9 AE A3 7F CC 15 04 0C CD EE 44 06 C4", "T20 B117 (UTF-8)" }, - /* 31*/ { UNICODE_MODE, 0, -1, "\000\014\033 #/059:<@AMZ", 15, 0, 0, "2F 80 31 B7 1F AF E0 05 27 EB 2E CB E2 96 8F F0 00", "T15 (ASCII)" }, - /* 32*/ { UNICODE_MODE, 0, -1, "Z[\\`alz{~\177", -1, 0, 0, "28 FE CF 4E 3E 92 FF 7E E7 CF 7F 00 00", "T10 (ASCII)" }, - /* 33*/ { DATA_MODE, 26, ZINT_FULL_MULTIBYTE, "\202\061\203\063", -1, 0, 26, "81 A7 01 B1 D8 00 00 00 00", "ECI-26 H(f)1 (GB 18030) (Invalid UTF-8, forces GB 2312/18030 utf8tosb() difference) NOTE: 2021-01-10 now UTF-8 is checked and mode -> DATA_MODE this test no longer shows difference" }, - /* 34*/ { UNICODE_MODE, 128, 0, "A", -1, 0, 128, "88 08 02 2B F0 00 00 00 00", "ECI > 127" }, - /* 35*/ { UNICODE_MODE, 16364, 0, "A", -1, 0, 16364, "8B FE C2 2B F0 00 00 00 00", "ECI > 16363" }, - /* 36*/ { UNICODE_MODE, 0, -1, "啊啊啊亍", -1, 0, 0, "40 00 00 00 00 FF E0 00 FF F0 00 00 00", "Region 1 (FFE terminator) -> Region 2 (no indicator)" }, - /* 37*/ { UNICODE_MODE, 0, -1, "亍亍亍啊", -1, 0, 0, "50 00 00 00 00 FF E0 00 FF F0 00 00 00", "Region 2 (FFE terminator) -> Region 1 (no indicator)" }, - /* 38*/ { UNICODE_MODE, 0, -1, "啊啊啊啊亍亍啊", -1, 0, 0, "40 00 00 00 00 00 0F FE 00 00 00 FF E0 00 FF F0 00", "Region 1 (FFE) -> Region 2 (FFE) -> Region 1" }, - /* 39*/ { UNICODE_MODE, 0, -1, "亍亍亍亍啊啊亍", -1, 0, 0, "50 00 00 00 00 00 0F FE 00 00 00 FF E0 00 FF F0 00", "Region 2 (FFE) -> Region 1 (FFE) -> Region 2" }, - /* 40*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE | (2 << 8), "é", -1, 0, 0, "47 02 FF F0 00 00 00 00 00", "H(1)1 (UTF-8) (Region One) (full multibyte with mask)" }, - /* 41*/ { UNICODE_MODE, 0, -1, "˘", -1, 0, 0, "70 01 16 80 00 00 00 00 00", "H(f)1 (GB 18030)" }, - /* 42*/ { UNICODE_MODE, 4, -1, "˘", -1, 0, 4, "80 43 00 0D 10 00 00 00 00", "ECI-4 B1 (ISO 8859-2)" }, - /* 43*/ { UNICODE_MODE, 0, -1, "Ħ", -1, 0, 0, "70 00 47 80 00 00 00 00 00", "H(f)1 (GB 18030)" }, - /* 44*/ { UNICODE_MODE, 5, -1, "Ħ", -1, 0, 5, "80 53 00 0D 08 00 00 00 00", "ECI-5 B1 (ISO 8859-3)" }, - /* 45*/ { UNICODE_MODE, 0, -1, "ĸ", -1, 0, 0, "70 00 50 00 00 00 00 00 00", "H(f)1 (GB 18030)" }, - /* 46*/ { UNICODE_MODE, 6, -1, "ĸ", -1, 0, 6, "80 63 00 0D 10 00 00 00 00", "ECI-6 B1 (ISO 8859-4)" }, - /* 47*/ { UNICODE_MODE, 0, -1, "Ж", -1, 0, 0, "30 01 53 D4 00 00 00 00 00", "B2 (GB 18030)" }, - /* 48*/ { UNICODE_MODE, 7, -1, "Ж", -1, 0, 7, "80 73 00 0D B0 00 00 00 00", "ECI-7 B1 (ISO 8859-5)" }, - /* 49*/ { UNICODE_MODE, 0, -1, "Ș", -1, 0, 0, "70 00 B9 80 00 00 00 00 00", "H(f)1 (GB 18030)" }, - /* 50*/ { UNICODE_MODE, 18, -1, "Ș", -1, 0, 18, "81 23 00 0D 50 00 00 00 00", "ECI-18 B1 (ISO 8859-16)" }, - /* 51*/ { UNICODE_MODE, 0, -1, "テ", -1, 0, 0, "30 01 52 E3 00 00 00 00 00", "B2 (GB 18030)" }, - /* 52*/ { UNICODE_MODE, 20, -1, "テ", -1, 0, 20, "81 43 00 14 1B 28 00 00 00", "ECI-20 B2 (SHIFT JIS)" }, - /* 53*/ { UNICODE_MODE, 20, -1, "テテ", -1, 0, 20, "81 43 00 24 1B 2C 1B 28 00", "ECI-20 B4 (SHIFT JIS)" }, - /* 54*/ { UNICODE_MODE, 20, -1, "\\\\", -1, 0, 20, "81 43 00 24 0A FC 0A F8 00", "ECI-20 B4 (SHIFT JIS)" }, - /* 55*/ { UNICODE_MODE, 0, -1, "…", -1, 0, 0, "4E BC FF F0 00 00 00 00 00", "H(1)1 (GB 18030)" }, - /* 56*/ { UNICODE_MODE, 21, -1, "…", -1, 0, 21, "81 53 00 0C 28 00 00 00 00", "ECI-21 B1 (Win 1250)" }, - /* 57*/ { UNICODE_MODE, 0, -1, "Ґ", -1, 0, 0, "70 01 B9 00 00 00 00 00 00", "H(f)1 (GB 18030)" }, - /* 58*/ { UNICODE_MODE, 22, -1, "Ґ", -1, 0, 22, "81 63 00 0D 28 00 00 00 00", "ECI-22 B1 (Win 1251)" }, - /* 59*/ { UNICODE_MODE, 0, -1, "˜", -1, 0, 0, "70 01 18 00 00 00 00 00 00", "H(f)1 (GB 18030)" }, - /* 60*/ { UNICODE_MODE, 23, -1, "˜", -1, 0, 23, "81 73 00 0C C0 00 00 00 00", "ECI-23 B1 (Win 1252)" }, - /* 61*/ { UNICODE_MODE, 24, -1, "پ", -1, 0, 24, "81 83 00 0C 08 00 00 00 00", "ECI-24 B1 (Win 1256)" }, - /* 62*/ { UNICODE_MODE, 0, -1, "က", -1, 0, 0, "70 07 71 00 00 00 00 00 00", "H(f)1 (GB 18030)" }, - /* 63*/ { UNICODE_MODE, 25, -1, "က", -1, 0, 25, "81 92 F9 00 3F 00 00 00 00", "ECI-25 T2 (UCS-2BE)" }, - /* 64*/ { UNICODE_MODE, 25, -1, "ကက", -1, 0, 25, "81 92 F9 00 10 03 F0 00 00", "ECI-25 T4 (UCS-2BE)" }, - /* 65*/ { UNICODE_MODE, 25, -1, "12", -1, 0, 25, "81 93 00 20 01 88 01 90 00", "ECI-25 B4 (UCS-2BE ASCII)" }, - /* 66*/ { UNICODE_MODE, 27, -1, "@", -1, 0, 27, "81 B2 FB 2F C0 00 00 00 00", "ECI-27 T1 (ASCII)" }, - /* 67*/ { UNICODE_MODE, 0, -1, "龘", -1, 0, 0, "30 01 7E C9 80 00 00 00 00", "B2 (GB 18030)" }, - /* 68*/ { UNICODE_MODE, 28, -1, "龘", -1, 0, 28, "81 C3 00 17 CE A8 00 00 00", "ECI-28 B2 (Big5)" }, - /* 69*/ { UNICODE_MODE, 28, -1, "龘龘", -1, 0, 28, "81 C3 00 27 CE AF CE A8 00", "ECI-28 B4 (Big5)" }, - /* 70*/ { UNICODE_MODE, 0, -1, "齄", -1, 0, 0, "5B BF FF F0 00 00 00 00 00", "H(2)1 (GB 18030)" }, - /* 71*/ { UNICODE_MODE, 29, -1, "齄", -1, 0, 29, "81 D5 BB FF FF 00 00 00 00", "ECI-29 H(2)1 (GB 2312)" }, - /* 72*/ { UNICODE_MODE, 29, -1, "齄齄", -1, 0, 29, "81 D5 BB FB BF FF F0 00 00", "ECI-29 H(2)2 (GB 2312)" }, - /* 73*/ { UNICODE_MODE, 0, -1, "가", -1, 0, 0, "70 2B 5E 80 00 00 00 00 00", "H(f)1 (GB 18030)" }, - /* 74*/ { UNICODE_MODE, 30, -1, "가", -1, 0, 30, "81 E3 00 15 85 08 00 00 00", "ECI-30 T2 (EUC-KR)" }, - /* 75*/ { UNICODE_MODE, 30, -1, "가가", -1, 0, 30, "81 E3 00 25 85 0D 85 08 00", "ECI-30 B4 (EUC-KR)" }, - /* 76*/ { UNICODE_MODE, 170, -1, "?", -1, 0, 170, "88 0A A2 FB 1F C0 00 00 00", "ECI-170 L1 (ASCII invariant)" }, - /* 77*/ { DATA_MODE, 899, -1, "\200", -1, 0, 899, "88 38 33 00 0C 00 00 00 00", "ECI-899 B1 (8-bit binary)" }, - /* 78*/ { UNICODE_MODE, 900, -1, "é", -1, 0, 900, "88 38 43 00 16 1D 48 00 00", "ECI-900 B2 (no conversion)" }, - /* 79*/ { UNICODE_MODE, 16384, -1, "é", -1, 0, 16384, "8C 04 00 03 00 16 1D 48 00", "ECI-16384 B2 (no conversion)" }, - /* 80*/ { UNICODE_MODE, 3, -1, "β", -1, ZINT_ERROR_INVALID_DATA, 3, "Error 545: Invalid character in input data for ECI 3", "" }, + /* 2*/ { UNICODE_MODE, 29, -1, "é", -1, 0, 29, "81 D3 00 15 45 30 00 00 00", "ECI-29 B2 (GB 2312)" }, + /* 3*/ { UNICODE_MODE, 32, -1, "é", -1, 0, 32, "82 04 FC FF FF 00 00 00 00", "ECI-32 H(1)1 (GB 18030) (Region One)" }, + /* 4*/ { UNICODE_MODE, 26, -1, "é", -1, 0, 26, "81 A3 00 16 1D 48 00 00 00", "ECI-26 B2 (UTF-8)" }, + /* 5*/ { UNICODE_MODE, 26, ZINT_FULL_MULTIBYTE, "é", -1, 0, 26, "81 A4 70 2F FF 00 00 00 00", "ECI-26 H(1)1 (Region One) (UTF-8) (full multibyte)" }, + /* 6*/ { DATA_MODE, 0, -1, "é", -1, 0, 0, "30 01 61 D4 80 00 00 00 00", "B2 (UTF-8)" }, + /* 7*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "é", -1, 0, 0, "47 02 FF F0 00 00 00 00 00", "H(1)1 (UTF-8) (Region One) (full multibyte)" }, + /* 8*/ { DATA_MODE, 0, -1, "\351", -1, 0, 0, "30 00 F4 80 00 00 00 00 00", "B1 (ISO 8859-1) (0xE9)" }, + /* 9*/ { UNICODE_MODE, 0, -1, "β", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 30 01 53 61 00 00 00 00 00", "B2 (GB 18030) (2-byte Region)" }, + /* 10*/ { UNICODE_MODE, 9, -1, "β", -1, 0, 9, "80 93 00 0F 10 00 00 00 00", "ECI-9 B1 (ISO 8859-7)" }, + /* 11*/ { UNICODE_MODE, 29, -1, "β", -1, 0, 29, "81 D3 00 15 36 10 00 00 00", "ECI-29 B2 (GB 2312)" }, + /* 12*/ { UNICODE_MODE, 32, -1, "β", -1, 0, 32, "82 03 00 15 36 10 00 00 00", "ECI-32 B2 (GB 18030) (2-byte Region)" }, + /* 13*/ { UNICODE_MODE, 26, -1, "β", -1, 0, 26, "81 A3 00 16 75 90 00 00 00", "ECI-26 B2 (UTF-8)" }, + /* 14*/ { UNICODE_MODE, 26, ZINT_FULL_MULTIBYTE, "β", -1, 0, 26, "81 A4 B1 5F FF 00 00 00 00", "ECI-26 B2 (UTF-8) (full multibyte)" }, + /* 15*/ { DATA_MODE, 0, -1, "β", -1, 0, 0, "30 01 67 59 00 00 00 00 00", "B2 (UTF-8)" }, + /* 16*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "β", -1, 0, 0, "4B 15 FF F0 00 00 00 00 00", "H(1)1 (UTF-8) (Region One) (full multibyte)" }, + /* 17*/ { UNICODE_MODE, 0, -1, "ÿ", -1, 0, 0, "30 00 FF 80 00 00 00 00 00", "B1 (ISO 8859-1)" }, + /* 18*/ { UNICODE_MODE, 0, -1, "ÿÿÿ", -1, 0, 0, "30 01 FF FF FF 80 00 00 00", "B3 (ISO 8859-1)" }, + /* 19*/ { UNICODE_MODE, 0, -1, "\302\200", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 00 00 00 00 00 00 00 00", "H(f)1 (GB 18030) (4-byte Region) (not DATA_MODE so GB 18030 mapping)" }, + /* 20*/ { UNICODE_MODE, 0, ZINT_FULL_MULTIBYTE, "\302\200", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 00 00 00 00 00 00 00 00", "H(f)1 (GB 18030) (4-byte Region)" }, + /* 21*/ { DATA_MODE, 0, 0, "\302\200", -1, 0, 0, "30 01 61 40 00 00 00 00 00", "B2 (UTF-8)" }, + /* 22*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "\302\200", -1, 0, 0, "30 01 61 40 00 00 00 00 00", "B2 (UTF-8) (full multibyte)" }, + /* 23*/ { UNICODE_MODE, 0, -1, "\302\200�", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 00 00 38 26 7E 40 00 00", "H(f)2 (GB 18030) (both 4-byte Region) (not DATA_MODE so GB 18030 mapping)" }, + /* 24*/ { UNICODE_MODE, 0, ZINT_FULL_MULTIBYTE, "\302\200�", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 00 00 38 26 7E 40 00 00", "H(f)2 (GB 18030) (both 4-byte Region)" }, + /* 25*/ { UNICODE_MODE, 0, -1, "啊亍齄丂\302\200", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 64 68 50 3C AC 28 80 00 FF FE E0 00 00", "H(d)4 H(f)1 (GB 18030)" }, + /* 26*/ { DATA_MODE, 0, -1, "\177\177", -1, 0, 0, "2F BD F7 F0 00 00 00 00 00", "T2 (ASCII)" }, + /* 27*/ { DATA_MODE, 0, -1, "\177\177\177", -1, 0, 0, "2F BD F7 DF C0 00 00 00 00", "T3 (ASCII)" }, + /* 28*/ { UNICODE_MODE, 0, -1, "123", -1, 0, 0, "11 EF FF 00 00 00 00 00 00", "N3 (ASCII)" }, + /* 29*/ { UNICODE_MODE, 0, -1, "12345", -1, 0, 0, "11 EC 2D FF 80 00 00 00 00", "N5 (ASCII)" }, + /* 30*/ { UNICODE_MODE, 0, -1, "Aa%$Bb9", -1, 0, 0, "22 A4 FA 18 3E 2E 52 7F 00", "T7 (ASCII)" }, + /* 31*/ { UNICODE_MODE, 0, -1, "Summer Palace Ticket for 6 June 2015 13:00;2015年6月6日夜01時00分PM頤和園のチケット;2015년6월6일13시오후여름궁전티켓.2015年6月6号下午13:00的颐和园门票;", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning (171) 27 38 C3 0A 35 F9 CF 99 92 F9 26 A3 E7 3E 76 C9 AE A3 7F CC 08 04 0C CD EE 44 06 C4", "T20 B64 N4 H(f)1 T1 H(f)1 T1 H(f)1 T2 H(f)9 B35 (GB 18030)" }, + /* 32*/ { DATA_MODE, 0, -1, "Summer Palace Ticket for 6 June 2015 13:00;2015年6月6日夜01時00分PM頤和園のチケット;2015년6월6일13시오후여름궁전티켓.2015年6月6号下午13:00的颐和园门票;", -1, 0, 0, "(209) 27 38 C3 0A 35 F9 CF 99 92 F9 26 A3 E7 3E 76 C9 AE A3 7F CC 15 04 0C CD EE 44 06 C4", "T20 B117 (UTF-8)" }, + /* 33*/ { UNICODE_MODE, 0, -1, "\000\014\033 #/059:<@AMZ", 15, 0, 0, "2F 80 31 B7 1F AF E0 05 27 EB 2E CB E2 96 8F F0 00", "T15 (ASCII)" }, + /* 34*/ { UNICODE_MODE, 0, -1, "Z[\\`alz{~\177", -1, 0, 0, "28 FE CF 4E 3E 92 FF 7E E7 CF 7F 00 00", "T10 (ASCII)" }, + /* 35*/ { DATA_MODE, 26, ZINT_FULL_MULTIBYTE, "\202\061\203\063", -1, 0, 26, "81 A7 01 B1 D8 00 00 00 00", "ECI-26 H(f)1 (GB 18030) (Invalid UTF-8, forces GB 2312/18030 utf8tosb() difference) NOTE: 2021-01-10 now UTF-8 is checked and mode -> DATA_MODE this test no longer shows difference" }, + /* 36*/ { UNICODE_MODE, 128, 0, "A", -1, 0, 128, "88 08 02 2B F0 00 00 00 00", "ECI > 127" }, + /* 37*/ { UNICODE_MODE, 16364, 0, "A", -1, 0, 16364, "8B FE C2 2B F0 00 00 00 00", "ECI > 16363" }, + /* 38*/ { UNICODE_MODE, 0, -1, "啊啊啊亍", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 40 00 00 00 00 FF E0 00 FF F0 00 00 00", "Region 1 (FFE terminator) -> Region 2 (no indicator)" }, + /* 39*/ { UNICODE_MODE, 0, -1, "亍亍亍啊", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 50 00 00 00 00 FF E0 00 FF F0 00 00 00", "Region 2 (FFE terminator) -> Region 1 (no indicator)" }, + /* 40*/ { UNICODE_MODE, 0, -1, "啊啊啊啊亍亍啊", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 40 00 00 00 00 00 0F FE 00 00 00 FF E0 00 FF F0 00", "Region 1 (FFE) -> Region 2 (FFE) -> Region 1" }, + /* 41*/ { UNICODE_MODE, 0, -1, "亍亍亍亍啊啊亍", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 50 00 00 00 00 00 0F FE 00 00 00 FF E0 00 FF F0 00", "Region 2 (FFE) -> Region 1 (FFE) -> Region 2" }, + /* 42*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE | (2 << 8), "é", -1, 0, 0, "47 02 FF F0 00 00 00 00 00", "H(1)1 (UTF-8) (Region One) (full multibyte with mask)" }, + /* 43*/ { UNICODE_MODE, 0, -1, "˘", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 01 16 80 00 00 00 00 00", "H(f)1 (GB 18030)" }, + /* 44*/ { UNICODE_MODE, 4, -1, "˘", -1, 0, 4, "80 43 00 0D 10 00 00 00 00", "ECI-4 B1 (ISO 8859-2)" }, + /* 45*/ { UNICODE_MODE, 0, -1, "Ħ", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 00 47 80 00 00 00 00 00", "H(f)1 (GB 18030)" }, + /* 46*/ { UNICODE_MODE, 5, -1, "Ħ", -1, 0, 5, "80 53 00 0D 08 00 00 00 00", "ECI-5 B1 (ISO 8859-3)" }, + /* 47*/ { UNICODE_MODE, 0, -1, "ĸ", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 00 50 00 00 00 00 00 00", "H(f)1 (GB 18030)" }, + /* 48*/ { UNICODE_MODE, 6, -1, "ĸ", -1, 0, 6, "80 63 00 0D 10 00 00 00 00", "ECI-6 B1 (ISO 8859-4)" }, + /* 49*/ { UNICODE_MODE, 0, -1, "Ж", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 30 01 53 D4 00 00 00 00 00", "B2 (GB 18030)" }, + /* 50*/ { UNICODE_MODE, 7, -1, "Ж", -1, 0, 7, "80 73 00 0D B0 00 00 00 00", "ECI-7 B1 (ISO 8859-5)" }, + /* 51*/ { UNICODE_MODE, 0, -1, "Ș", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 00 B9 80 00 00 00 00 00", "H(f)1 (GB 18030)" }, + /* 52*/ { UNICODE_MODE, 18, -1, "Ș", -1, 0, 18, "81 23 00 0D 50 00 00 00 00", "ECI-18 B1 (ISO 8859-16)" }, + /* 53*/ { UNICODE_MODE, 0, -1, "テ", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 30 01 52 E3 00 00 00 00 00", "B2 (GB 18030)" }, + /* 54*/ { UNICODE_MODE, 20, -1, "テ", -1, 0, 20, "81 43 00 14 1B 28 00 00 00", "ECI-20 B2 (SHIFT JIS)" }, + /* 55*/ { UNICODE_MODE, 20, -1, "テテ", -1, 0, 20, "81 43 00 24 1B 2C 1B 28 00", "ECI-20 B4 (SHIFT JIS)" }, + /* 56*/ { UNICODE_MODE, 20, -1, "\\\\", -1, 0, 20, "81 43 00 24 0A FC 0A F8 00", "ECI-20 B4 (SHIFT JIS)" }, + /* 57*/ { UNICODE_MODE, 0, -1, "…", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 4E BC FF F0 00 00 00 00 00", "H(1)1 (GB 18030)" }, + /* 58*/ { UNICODE_MODE, 21, -1, "…", -1, 0, 21, "81 53 00 0C 28 00 00 00 00", "ECI-21 B1 (Win 1250)" }, + /* 59*/ { UNICODE_MODE, 0, -1, "Ґ", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 01 B9 00 00 00 00 00 00", "H(f)1 (GB 18030)" }, + /* 60*/ { UNICODE_MODE, 22, -1, "Ґ", -1, 0, 22, "81 63 00 0D 28 00 00 00 00", "ECI-22 B1 (Win 1251)" }, + /* 61*/ { UNICODE_MODE, 0, -1, "˜", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 01 18 00 00 00 00 00 00", "H(f)1 (GB 18030)" }, + /* 62*/ { UNICODE_MODE, 23, -1, "˜", -1, 0, 23, "81 73 00 0C C0 00 00 00 00", "ECI-23 B1 (Win 1252)" }, + /* 63*/ { UNICODE_MODE, 24, -1, "پ", -1, 0, 24, "81 83 00 0C 08 00 00 00 00", "ECI-24 B1 (Win 1256)" }, + /* 64*/ { UNICODE_MODE, 0, -1, "က", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 07 71 00 00 00 00 00 00", "H(f)1 (GB 18030)" }, + /* 65*/ { UNICODE_MODE, 25, -1, "က", -1, 0, 25, "81 92 F9 00 3F 00 00 00 00", "ECI-25 T2 (UCS-2BE)" }, + /* 66*/ { UNICODE_MODE, 25, -1, "ကက", -1, 0, 25, "81 92 F9 00 10 03 F0 00 00", "ECI-25 T4 (UCS-2BE)" }, + /* 67*/ { UNICODE_MODE, 25, -1, "12", -1, 0, 25, "81 93 00 20 01 88 01 90 00", "ECI-25 B4 (UCS-2BE ASCII)" }, + /* 68*/ { UNICODE_MODE, 27, -1, "@", -1, 0, 27, "81 B2 FB 2F C0 00 00 00 00", "ECI-27 T1 (ASCII)" }, + /* 69*/ { UNICODE_MODE, 0, -1, "龘", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 30 01 7E C9 80 00 00 00 00", "B2 (GB 18030)" }, + /* 70*/ { UNICODE_MODE, 28, -1, "龘", -1, 0, 28, "81 C3 00 17 CE A8 00 00 00", "ECI-28 B2 (Big5)" }, + /* 71*/ { UNICODE_MODE, 28, -1, "龘龘", -1, 0, 28, "81 C3 00 27 CE AF CE A8 00", "ECI-28 B4 (Big5)" }, + /* 72*/ { UNICODE_MODE, 0, -1, "齄", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 5B BF FF F0 00 00 00 00 00", "H(2)1 (GB 18030)" }, + /* 73*/ { UNICODE_MODE, 29, -1, "齄", -1, 0, 29, "81 D3 00 17 BF F0 00 00 00", "ECI-29 B2 (GB 2312)" }, + /* 74*/ { UNICODE_MODE, 32, -1, "齄", -1, 0, 32, "82 05 BB FF FF 00 00 00 00", "ECI-32 H(2)1 (GB 2312)" }, + /* 75*/ { UNICODE_MODE, 29, -1, "齄齄", -1, 0, 29, "81 D3 00 27 BF F7 BF F0 00", "ECI-29 B4 (GB 2312)" }, + /* 76*/ { UNICODE_MODE, 32, -1, "齄齄", -1, 0, 32, "82 05 BB FB BF FF F0 00 00", "ECI-32 H(2)2 (GB 2312)" }, + /* 77*/ { UNICODE_MODE, 0, -1, "가", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 2B 5E 80 00 00 00 00 00", "H(f)1 (GB 18030)" }, + /* 78*/ { UNICODE_MODE, 30, -1, "가", -1, 0, 30, "81 E3 00 15 85 08 00 00 00", "ECI-30 T2 (EUC-KR)" }, + /* 79*/ { UNICODE_MODE, 30, -1, "가가", -1, 0, 30, "81 E3 00 25 85 0D 85 08 00", "ECI-30 B4 (EUC-KR)" }, + /* 80*/ { UNICODE_MODE, 170, -1, "?", -1, 0, 170, "88 0A A2 FB 1F C0 00 00 00", "ECI-170 L1 (ASCII invariant)" }, + /* 81*/ { DATA_MODE, 899, -1, "\200", -1, 0, 899, "88 38 33 00 0C 00 00 00 00", "ECI-899 B1 (8-bit binary)" }, + /* 82*/ { UNICODE_MODE, 900, -1, "é", -1, 0, 900, "88 38 43 00 16 1D 48 00 00", "ECI-900 B2 (no conversion)" }, + /* 83*/ { UNICODE_MODE, 16384, -1, "é", -1, 0, 16384, "8C 04 00 03 00 16 1D 48 00", "ECI-16384 B2 (no conversion)" }, + /* 84*/ { UNICODE_MODE, 3, -1, "β", -1, ZINT_ERROR_INVALID_DATA, 3, "Error 545: Invalid character in input data for ECI 3", "" }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -302,10 +305,12 @@ static void test_encode(int index, int generate, int debug) { struct item { int input_mode; + int eci; int option_1; int option_2; int option_3; char *data; + int length; int ret; int expected_rows; @@ -314,7 +319,7 @@ static void test_encode(int index, int generate, int debug) { char *expected; }; struct item data[] = { - /* 0*/ { UNICODE_MODE, -1, -1, -1, "1234", 0, 23, 23, "Mode nnnn, mask 10", + /* 0*/ { UNICODE_MODE, -1, -1, -1, -1, "1234", -1, 0, 23, 23, "Mode nnnn, mask 10", "11111110101011001111111" "10000000000000100000001" "10111110111011101111101" @@ -323,13 +328,13 @@ static void test_encode(int index, int generate, int debug) { "10101110000101001110101" "10101110111001101110101" "00000000100000000000000" - "00010101101110000010101" + "00010101101110000000000" "01010110110001011011101" "00100011000100100100101" "01110111111110001000111" "01001001110000001001000" "00100101001111110010000" - "10101000011110110101000" + "00000000011110110101000" "00000000001011100000000" "11111110110111101110101" "00000010011010001110101" @@ -339,7 +344,105 @@ static void test_encode(int index, int generate, int debug) { "11101010111111000000001" "11101010000100101111111" }, - /* 1*/ { UNICODE_MODE, 1, 1, -1, "1234567890", 0, 23, 23, "ISO 20830 Draft K.1 Figure K8 (& K5) same (mask 01), except no alternating filler in structural info in figure", + /* 1*/ { UNICODE_MODE, -1, 2, -1, -1, "Hanxin Code symbol", -1, 0, 25, 25, "ISO 20830 Figure 1 same", + "1111111010110110101111111" + "1000000000111101100000001" + "1011111011100101101111101" + "1010000010110010100000101" + "1010111000110100101110101" + "1010111001110110101110101" + "1010111010101001001110101" + "0000000011010101000000000" + "0001011001010001010000000" + "0110100011111001010001011" + "0011001010100011101101011" + "1000000000001101111111100" + "0000011000011000100100110" + "1101100011110010010011101" + "1010001101011111111100011" + "1010011001100100100010111" + "0000000100010101001101000" + "0000000000011111100000000" + "1111111000100100101110101" + "0000001011001111001110101" + "1111101010011001001110101" + "0000101010100100100000101" + "1110101011100100101111101" + "1110101010000010000000001" + "1110101011000100101111111" + }, + /* 2*/ { UNICODE_MODE, -1, -1, 24, 3 << 8, "汉信码标准\015\012中国物品编码中心\015\012北京网路畅想科技发展有限公司\015\012张成海、赵楠、黄燕滨、罗秋科、王毅、张铎、王越\015\012施煜、边峥、修兴强\015\012汉信码标准\015\012中国物品编码中心\015\012北京网路畅想科技发展有限公司", -1, ZINT_WARN_NONCOMPLIANT, 69, 69, "ISO 20830 Figure 2 **NOT SAME** different encodation, Binary mode not used by figure", + "111111100000010101011111111111111111000001110110100100011010101111111" + "100000001000101000000000000000000010100000101100000001101001100000001" + "101111100010110110110000010011001010001011001011111000011101001111101" + "101000001101000000011101000001111011111011100100111011110111100000101" + "101011100011110001100101001011100010111111001000111100100100101110101" + "101011100111101110110010000000000011101010010011101100010110001110101" + "101011101010101010011011010010010010010010010010010010010010001110101" + "000000001010001100000001110111011011010111111011100110110110100000000" + "001011001111000111100001011111111010110011111101011111001110010000000" + "110010110010111110111011010101001011101101111100111000010011011101101" + "101110110110101010111111111000001011000000011011110111001110011000110" + "101111000000000110111110011011011010010000100011111111111111111111111" + "110010010000101100011100110011011011000110111101000011101000101011001" + "100010100000100100100101000001110011100101000011011011110000000001110" + "100111000011001010001111101011100011100111110111110011100000011111111" + "100000110101001110001001110001110011000100110100010100011010110110110" + "110011011011110101001001001001001011001001001001001000001111111101000" + "111111111111111111001111011011111011111111111111111101111110011110101" + "000000000000000001100011001011111000000000000000000110010001010000000" + "110110011110001101011100110001011111000010110000100111001001001010101" + "101101111100100001001001111011001001001001011100110100010110000011100" + "011110010100101001111000101100000000010110100101000100111001011001011" + "111001001001001001001001001001001001110000101101010110011000000011001" + "100101011011010101001010000011001000110100111001010100001010011000101" + "100000000100100101111000011010110011000101110110100111110100010001001" + "001111101111001001100011101100001110101100100000100111011000100101111" + "011111011011000001000101100010011110101100010111110111111111111111111" + "010010010111001001000010000111000001111011101010000111101100111111110" + "110111011000101001100001010100010001010110110111010111000011010000010" + "101100010001010001001001100101110101001000011100100111000101010000101" + "100010011001001001111111110000001110011111100010110101111101101010000" + "010011110010110001101001001001001001001001000110110101100000100101100" + "100100011010110001110111000100110110011010000111100111111000110110001" + "000111000101011101001010010000001000101101011110110100100010110000100" + "100001110000101001111111111111111110101011101111100111111111111111111" + "000010011101101000000000000000000011110101101011110000000000000000001" + "101110101101101011000001000011001011010011111100011110110101001000001" + "101001001001001001001001111111100011010111110000100100111110101110001" + "111010111101101011100001010101100010000001011000111111010101110001101" + "110101101101100111110000010100100011000110100101101101101110001011101" + "110111111001111011011000111001101011100010001010010011010010000010101" + "111011110110100000001101000000001011000011111111111111111111111110001" + "101101100110000110110010000011111011101101011010110111001111010001001" + "110100010111011011000100000001110010110111101000111010101100010111101" + "110101000101110010100011111001000010011111111001011010001111000101001" + "111100110010110100110000111001111011101110110010101110100111001011101" + "100100101010010001001001001001001011001000110000010110101010100000001" + "100000100000010101001100101001111010110100000101100000111100011100001" + "111101001111100101011110011001100011001010001001110101111111011001001" + "111000110000111001100101000010110011001010001110110100010110101111101" + "100111001001010101110001010011110011011111111110000001100111111111100" + "111111111111111111010010010010011011111111111111111101100010000111001" + "000000000000000001110011001010110000000000000000000110101011111101000" + "001010010101010001010011101100101101010110000101110111010011101010111" + "000000101111101101011110000110011001100110000111000101010011000010100" + "110000010111110101011100101110000111110000001110010111011001000111001" + "010001011000000101001111001010101111111111111111110111111110010110101" + "001110100110111101101101110011010000101111100110000111100011000111111" + "110111101011110101000001101000011001000111000100110100010101101110001" + "001010010111110001101110111111000010010101101011110101000100001011100" + "000000010100000101101001100011110110000111101011110110111101100110100" + "000000001110100001111111001001001001001001001001000101001100100000000" + "111111100000001101101111110101111101000000111010000101110001101110101" + "000000100010001101101110011011101000001000000111110110010011001110101" + "111110101110111001110110010111000001010100011111010100010110001110101" + "000010101101010001101101011100110110111100100000010100100100100000101" + "111010100001110001011110100111100101101101100011010101011011001111101" + "111010101000100001010101001001000000010001001001000101001001100000001" + "111010101111111101111111111111111010111111111111110111111111001111111" + }, + /* 3*/ { UNICODE_MODE, -1, 1, 1, -1, "1234567890", -1, 0, 23, 23, "ISO 20830 K.2 Figure K.8 (& K.5) same (mask 01)", "11111110001000001111111" "10000000110001100000001" "10111110001010101111101" @@ -348,13 +451,13 @@ static void test_encode(int index, int generate, int debug) { "10101110110101001110101" "10101110001100001110101" "00000000011101100000000" - "00010101001010011010101" + "00010101001010011000000" "01001101111101010101110" "10101010101010100101101" "01010010111101010101010" "10101010101010101010100" "10000011010101000011110" - "10101011001010010101000" + "00000011001010010101000" "00000000110100000000000" "11111110011110001110101" "00000010010101101110101" @@ -364,7 +467,7 @@ static void test_encode(int index, int generate, int debug) { "11101010110101100000001" "11101010001010001111111" }, - /* 2*/ { UNICODE_MODE, 1, 1, 1 << 8, "1234567890", 0, 23, 23, "ISO 20830 Draft K.1 Figure K4, with explicit mask pattern 00, same except no alternating filler in figure", + /* 4*/ { UNICODE_MODE, -1, 1, 1, 1 << 8, "1234567890", -1, 0, 23, 23, "ISO 20830 K.2 Figure K.4, with explicit mask pattern 00", "11111110100010101111111" "10000000000100100000001" "10111110000000101111101" @@ -373,13 +476,13 @@ static void test_encode(int index, int generate, int debug) { "10101110000000001110101" "10101110000110001110101" "00000000001000100000000" - "00010101000000100010101" + "00010101000000100000000" "00011000101000000000100" "00000000000000001111000" "00000111101000000000000" "00000000000000000000001" "11010110000000010110100" - "10101000100000010101000" + "00000000100000010101000" "00000000100001000000000" "11111110010100001110101" "00000010000000001110101" @@ -389,7 +492,7 @@ static void test_encode(int index, int generate, int debug) { "11101010100000000000001" "11101010100000101111111" }, - /* 3*/ { UNICODE_MODE, 1, 1, 3 << 8, "1234567890", 0, 23, 23, "ISO 20830 Draft K.1 Figure K6, with explicit mask pattern 10, same except no alternating filler in figure", + /* 5*/ { UNICODE_MODE, -1, 1, 1, 3 << 8, "1234567890", -1, 0, 23, 23, "ISO 20830 K.2 Figure K.6, with explicit mask pattern 10", "11111110001011101111111" "10000000100000000000001" "10111110011111001111101" @@ -398,13 +501,13 @@ static void test_encode(int index, int generate, int debug) { "10101110011111101110101" "10101110101111101110101" "00000000001100000000000" - "00010101011111010010101" + "00010101011111010000000" "01010001100001001001101" "00100100100100101011100" "11111000010111111111111" "01001001001001001001000" "11110010100100110010000" - "10101001011111010101000" + "00000001011111010101000" "00000000001000000000000" "11111110110000101110101" "00000010111111001110101" @@ -414,7 +517,7 @@ static void test_encode(int index, int generate, int debug) { "11101010001001100000001" "11101010100100001111111" }, - /* 4*/ { UNICODE_MODE, 1, 1, 4 << 8, "1234567890", 0, 23, 23, "ISO 20830 Draft K.1 Figure K7, with explicit mask pattern 11, same except no alternating filler in figure", + /* 6*/ { UNICODE_MODE, -1, 1, 1, 4 << 8, "1234567890", -1, 0, 23, 23, "ISO 20830 K.2 Figure K.7, with explicit mask pattern 11", "11111110101111001111111" "10000000000011000000001" "10111110000000001111101" @@ -423,13 +526,13 @@ static void test_encode(int index, int generate, int debug) { "10101110100111101110101" "10101110111111101110101" "00000000001111000000000" - "00010101000111101010101" + "00010101000111101000000" "00000010110000111000011" "10011010011111001000011" "11000010000111000111000" "01000101101110111000110" "00010001101101010001100" - "10101010110010010101000" + "00000010110010010101000" "00000000010011000000000" "11111110100110101110101" "00000010101101101110101" @@ -439,7 +542,7 @@ static void test_encode(int index, int generate, int debug) { "11101010011010000000001" "11101010011010101111111" }, - /* 5*/ { UNICODE_MODE, 3, 10, -1, "1234567890ABCDEFGabcdefg,Han Xin Code", 0, 41, 41, "ISO 20830 Draft K.2 Figure K16 (& K14) (happens to use same mask pattern 10), same except for alternating filler", + /* 7*/ { UNICODE_MODE, -1, 3, 10, -1, "1234567890ABCDEFGabcdefg,Han Xin Code", -1, 0, 41, 41, "ISO 20830 K.3 Figure K.16 (& K.14) (happens to use same mask pattern 10)", "11111110001011000000100000010101101111111" "10000000001011110010000000011010100000001" "10111110111111111010111011101111101111101" @@ -448,7 +551,7 @@ static void test_encode(int index, int generate, int debug) { "10101110010111110111111011101100101110101" "10101110101111001001011101110011001110101" "00000000011001100100100100100100100000000" - "00011110111111111111111001101111110010101" + "00011110111111111111111001101111110000000" "10110011011100110010001001100000001001001" "11001100100100100100100100100100100100100" "11111111001110101101011011110011011110110" @@ -472,7 +575,7 @@ static void test_encode(int index, int generate, int debug) { "11111111111110110000111000110000110000101" "00000001001001001000101011011100000100101" "00100100100100100100100100100100101011111" - "10101001100101110100111011100010101111000" + "00000001100101110100111011100010101111000" "00000000110001001000101001001111000000000" "11111110001011100100100100100100101110101" "00000010111111111110111111111111001110101" @@ -482,7 +585,7 @@ static void test_encode(int index, int generate, int debug) { "11101010101001001000101001001001000000001" "11101010100100100100111111111111001111111" }, - /* 6*/ { UNICODE_MODE, 3, 10, 1 << 8, "1234567890ABCDEFGabcdefg,Han Xin Code", 0, 41, 41, "ISO 20830 Draft K.2 Figure K12 explicit mask pattern 00, same except for alternating filler", + /* 8*/ { UNICODE_MODE, -1, 3, 10, 1 << 8, "1234567890ABCDEFGabcdefg,Han Xin Code", -1, 0, 41, 41, "ISO 20830 K.3 Figure K.12 explicit mask pattern 00", "11111110100010001000101001011100101111111" "10000000101111010110000100111110000000001" "10111110100000000101000100010000001111101" @@ -491,7 +594,7 @@ static void test_encode(int index, int generate, int debug) { "10101110001000001000000100010011001110101" "10101110000110000000010100111010101110101" "00000000011101000000000000000000000000000" - "00011110100000000000000110010000000010101" + "00011110100000000000000110010000000000000" "11111010010101111011000000101001000000000" "11101000000000000000000000000000000000000" "10000000110001010010100100001100100001001" @@ -515,7 +618,7 @@ static void test_encode(int index, int generate, int debug) { "00000000000001001110100111001111001111010" "01001000000000000000100010010101001101100" "00000000000000000000100000000000001111011" - "10101000011010001010100100011101101111000" + "00000000011010001010100100011101101111000" "00000000011000000000100000000110000000000" "11111110101111000000100000000000001110101" "00000010000000000000100000000000001110101" @@ -525,7 +628,7 @@ static void test_encode(int index, int generate, int debug) { "11101010000000000000100000000000100000001" "11101010100000000000111111111111101111111" }, - /* 7*/ { UNICODE_MODE, 3, 10, 2 << 8, "1234567890ABCDEFGabcdefg,Han Xin Code", 0, 41, 41, "ISO 20830 Draft K.2 Figure K13 explicit mask pattern 01, same except for alternating filler", + /* 9*/ { UNICODE_MODE, -1, 3, 10, 2 << 8, "1234567890ABCDEFGabcdefg,Han Xin Code", -1, 0, 41, 41, "ISO 20830 K.3 Figure K.13 explicit mask pattern 01", "11111110001000100010100011110110001111111" "10000000011010000010000001101011000000001" "10111110101010101111101110111010001111101" @@ -534,7 +637,7 @@ static void test_encode(int index, int generate, int debug) { "10101110111101011101010001000110001110101" "10101110001100101010111110010000101110101" "00000000001000010101010101010101000000000" - "00011110101010101010101100111010111010101" + "00011110101010101010101100111010111000000" "10101111000000101110010101111100010101010" "11000010101010101010101010101010101010101" "11010101100100000111110001011001110100011" @@ -558,7 +661,7 @@ static void test_encode(int index, int generate, int debug) { "01010101010100011010110010011010011010000" "11100010101010101010101000111111100111001" "01010101010101010100110101010101011010001" - "10101011110000100000101110110111101111000" + "00000011110000100000101110110111101111000" "00000000001101010100110101010011000000000" "11111110100101101010101010101010001110101" "00000010010101010100110101010101101110101" @@ -568,7 +671,7 @@ static void test_encode(int index, int generate, int debug) { "11101010010101010100110101010101000000001" "11101010001010101010111111111111001111111" }, - /* 8*/ { UNICODE_MODE, 3, 10, 4 << 8, "1234567890ABCDEFGabcdefg,Han Xin Code", 0, 41, 41, "ISO 20830 Draft K.2 Figure K15 explicit mask pattern 11, same except for alternating filler", + /* 10*/ { UNICODE_MODE, -1, 3, 10, 4 << 8, "1234567890ABCDEFGabcdefg,Han Xin Code", -1, 0, 41, 41, "ISO 20830 K.3 Figure K.15 explicit mask pattern 11", "11111110101111100100100100110001001111111" "10000000101000010000000011111001100000001" "10111110100000000101000100010000101111101" @@ -577,7 +680,7 @@ static void test_encode(int index, int generate, int debug) { "10101110101111001111000011010100101110101" "10101110111111000111101100011101001110101" "00000000011010000111000111000111100000000" - "00011110100111000000111110010111001010101" + "00011110100111000000111110010111001000000" "11100000001101000011111000010001111000111" "11110010011111000111011000111000000111000" "11000101011110010101100011001011100110001" @@ -601,7 +704,7 @@ static void test_encode(int index, int generate, int debug) { "11000111100110000010101010100000001000010" "00001111100111001100101111111011110101011" "11000111100111001100101101101101001000011" - "10101010001010111000110110001111101111000" + "00000010001010111000110110001111101111000" "00000000101000111010110010010100000000000" "11111110011111111010110010010010101110101" "00000010101111000100101101101101101110101" @@ -611,7 +714,7 @@ static void test_encode(int index, int generate, int debug) { "11101010110010111000110010010010100000001" "11101010010010111000111111111111101111111" }, - /* 9*/ { UNICODE_MODE, 2, 17, -1, "Summer Palace Ticket for 6 June 2015 13:00;2015年6月6日夜01時00分PM頤和園のチケット;2015년6월6일13시오후여름궁전티켓.2015年6月6号下午13:00的颐和园门票;", 0, 55, 55, "**NOT SAME** as ISO 20830 Draft K.3 Figure K23, different encoding modes; if same encoding modes forced, uses mask pattern 01 instead of pattern 10, but matches pattern 01 example Figure K20 (excluding alternating filler) (forced encoding mode: ttttttttttttttttttttttttttttttttttttttttttttttt1t1t11ttdtt1ttddddddddtttttfftfftffttffffffffffffffffffttttt1t1t111ttttt111111t)", + /* 11*/ { UNICODE_MODE, -1, 2, 17, -1, "Summer Palace Ticket for 6 June 2015 13:00;2015年6月6日夜01時00分PM頤和園のチケット;2015년6월6일13시오후여름궁전티켓.2015年6月6号下午13:00的颐和园门票;", -1, ZINT_WARN_NONCOMPLIANT, 55, 55, "**NOT SAME** as ISO 20830 K.4 Figure K.23, different encodation; if same encoding modes forced, uses mask pattern 01 instead of pattern 10, but matches pattern 01 example Figure K.20 (forced encoding mode: ttttttttttttttttttttttttttttttttttttttttttttttt1t1t11ttdtt1ttddddddddtttttfftfftffttffffffffffffffffffttttt1t1t111ttttt111111t)", "1111111001111111111011100100110101101010101100101111111" "1000000000000000001100011000011001000010101111100000001" "1011111011110010101110010110100000111010101101101111101" @@ -620,7 +723,7 @@ static void test_encode(int index, int generate, int debug) { "1010111011010101001101010100001010011001000110001110101" "1010111001101001001001110010001001100100001001001110101" "0000000011100111101101111010001010001100110011000000000" - "0010010101010100001100111100101010101111010001101010101" + "0010010101010100001100111100101010101111010001101000000" "1111111011101110101000110010100010000101010101010101010" "1010100111011011001101110110100101100011101000111110110" "0011100111010001101001111011100001001111110010000011001" @@ -658,7 +761,7 @@ static void test_encode(int index, int generate, int debug) { "0001110000001011001100000011111101010101010101010101001" "1010011101001101001101011101000010010100010000001110101" "1101100101011001101001000100010000001101111001000111001" - "1010101010110101101010010110010011001111101011010100100" + "0000001010110101101010010110010011001111101011010100100" "0000000000000100001001100011100100010101010101100000000" "1111111000101010101010101110111100111011011111001110101" "0000001000101011001010000100010101001110001111101110101" @@ -668,7 +771,7 @@ static void test_encode(int index, int generate, int debug) { "1110101011010101001101010101010101000000001010000000001" "1110101011010001001111111111111111101000001110001111111" }, - /* 10*/ { UNICODE_MODE, -1, -1, -1, "汉信码标准", 0, 23, 23, "ISO 20830 Draft Figure 4, **NOT SAME**, uses mask 11 instead of 10 (note figure includes alternating filler)", + /* 12*/ { UNICODE_MODE, -1, -1, -1, -1, "汉信码标准", -1, ZINT_WARN_NONCOMPLIANT, 23, 23, "ISO 20830 Figure 4, **NOT SAME**, Zint uses mask 11 instead of 10 (note figure includes alternating filler)", "11111110000101001111111" "10000000001000100000001" "10111110110001001111101" @@ -677,13 +780,13 @@ static void test_encode(int index, int generate, int debug) { "10101110111101101110101" "10101110101100101110101" "00000000011001100000000" - "00010101110110000010101" + "00010101110110000000000" "01010010101111101111001" "11110010001011001101110" "01010110010010010011001" "11110011100000000111000" "11100110010101000010101" - "10101000010010110101000" + "00000000010010110101000" "00000000110011000000000" "11111110111011101110101" "00000010101101101110101" @@ -693,7 +796,7 @@ static void test_encode(int index, int generate, int debug) { "11101010111010000000001" "11101010011010001111111" }, - /* 11*/ { UNICODE_MODE, -1, -1, 3 << 8, "汉信码标准", 0, 23, 23, "ISO 20830 Draft Figure 4, explict mask 10, same", + /* 13*/ { UNICODE_MODE, -1, -1, -1, 3 << 8, "汉信码标准", -1, ZINT_WARN_NONCOMPLIANT, 23, 23, "ISO 20830 Figure 4, explict mask 10, same except no alternating filler", "11111110100001101111111" "10000000101011100000001" "10111110101110001111101" @@ -702,13 +805,13 @@ static void test_encode(int index, int generate, int debug) { "10101110000101101110101" "10101110111100101110101" "00000000011010100000000" - "00010101101110111010101" + "00010101101110111000000" "00000001111110011110111" "01001100110000101110001" "01101100000010101011110" "11111111000111110110110" "00000101011100100001001" - "10101011111111110101000" + "00000011111111110101000" "00000000101000000000000" "11111110101101101110101" "00000010111111001110101" @@ -718,69 +821,69 @@ static void test_encode(int index, int generate, int debug) { "11101010101001100000001" "11101010100100101111111" }, - /* 12*/ { UNICODE_MODE | ESCAPE_MODE, -1, 4, -1, "汉信码标准\015\012中国物品编码中心", 0, 29, 29, "ISO 20830 Draft Figure 5, **NOT SAME** uses mask 11 instead of 01", - "11111110000100101110101111111" - "10000000101110001001000000001" - "10111110111111111110001111101" - "10100000100100110100100000101" - "10101110001110001100101110101" - "10101110101111110111101110101" - "10101110111001111001101110101" - "00000000001000101101000000000" - "00011000111000000111100010101" - "10111010011011110000101001011" - "11100001011111000101000011011" - "10100000100100111100011010000" - "11001111001110010000001111100" - "11100000010111100111111000100" - "11111111111111101010110110101" - "00000000000000110101011111100" - "01111101011000101100111000101" - "01110101111110101110000100110" - "00000010111010111000111000110" - "00111111000100100010010110111" - "10101000100000111111100011000" - "00000000011110100101000000000" - "11111110100010100000101110101" - "00000010111100101101101110101" - "11111010101110110010001110101" - "00001010100000110011100000101" - "11101010011000100111101111101" - "11101010010110100010100000001" - "11101010111000111111001111111" + /* 14*/ { UNICODE_MODE | ESCAPE_MODE, -1, -1, 4, -1, "汉信码标准\015\012中国物品编码中心", -1, ZINT_WARN_NONCOMPLIANT, 29, 29, "ISO 20830 Figure 5, **NOT SAME** Zint uses mask 00 instead of 10", + "11111110001000100011001111111" + "10000000101000001110100000001" + "10111110111111111110101111101" + "10100000011100001100000000101" + "10101110010110001010101110101" + "10101110001000110000001110101" + "10101110000000111110001110101" + "00000000001111101010100000000" + "00011000111111000111101000000" + "10100000000011001000010001100" + "11111011000000000010011011100" + "11100101001011111011011101000" + "10001010100000101000110110100" + "10100111111010100000111111100" + "11111111111111101101110001101" + "00000000000000101101100111000" + "11101101001010110011111111101" + "10111010110010100001000011110" + "01001101110110110110000000001" + "11111000001000101111010001111" + "00000010110010101101100011000" + "00000000100100110111000000000" + "11111110011000110010001110101" + "00000010011000100000001110101" + "11111010101010111111001110101" + "00001010000110111110000000101" + "11101010100000110101101111101" + "11101010101110110000100000001" + "11101010000000111111001111111" }, - /* 13*/ { UNICODE_MODE | ESCAPE_MODE, -1, 4, 2 << 8, "汉信码标准\015\012中国物品编码中心", 0, 29, 29, "ISO 20830 Draft Figure 5, explicit mask 01, same", - "11111110100010101001101111111" - "10000000011100001011100000001" - "10111110110101010100101111101" - "10100000101001011001100000101" - "10101110111100100000101110101" - "10101110111101100101001110101" - "10101110001010010100001110101" - "00000000011010111111100000000" - "00011000110101101101010010101" - "11110101010110011101000100110" - "11010001101010101000110001001" - "10110000011110101110001000010" - "10100000001010000010011100001" - "11110010101111110101101010100" - "11111111111111100111011011001" - "00000000000000111000110010000" - "01000111100000111001010101000" - "11101111100110110100010110100" - "11100111011100111100101010100" - "10101101011100111010000100101" - "10101001011000100111100011000" - "00000000110000100010000000000" - "11111110010010111000001110101" - "00000010001100110101101110101" - "11111010100000110101101110101" - "00001010110010101011100000101" - "11101010101010111111101111101" - "11101010111010100101000000001" - "11101010101010111111101111111" + /* 15*/ { UNICODE_MODE | ESCAPE_MODE, -1, -1, 4, 3 << 8, "汉信码标准\015\012中国物品编码中心", -1, ZINT_WARN_NONCOMPLIANT, 29, 29, "ISO 20830 Figure 5, explicit mask 10, same except no alternating filler", + "11111110100000101010001111111" + "10000000001100001010000000001" + "10111110100000000001001111101" + "10100000010101000101000000101" + "10101110110010101110101110101" + "10101110010111001111101110101" + "10101110101001110111101110101" + "00000000001011001110000000000" + "00011000100000111000011000000" + "11101001001010000001011000101" + "11011111100100100110111111000" + "10011010110100000100100010111" + "11000011101001100001111111101" + "10000011011110000100011011000" + "11111111111111110010001110001" + "00000000000000100100101110000" + "11001001101110110111011011001" + "01000101001100111110111100001" + "00000100111110111111001001000" + "11011100101100101011110101011" + "00000011001100110010100011000" + "00000000001100111110000000000" + "11111110111100110110101110101" + "00000010100110111111001110101" + "11111010100010110110101110101" + "00001010000010111010000000101" + "11101010011110101010101111101" + "11101010000110111001000000001" + "11101010000100111111101111111" }, - /* 14*/ { UNICODE_MODE | ESCAPE_MODE, -1, 24, -1, "汉信码标准\015\012中国物品编码中心\015\012北京网路畅想科技发展有限公司\015\012张成海、赵楠、黄燕滨、罗秋科、王毅、张铎、王越\015\012施煜、边峥、修兴强\015\012汉信码标准\015\012中国物品编码中心\015\012北京网路畅想科技发展有限公司", 0, 69, 69, "ISO 20830 Draft Figure 6 **NOT SAME** different encodation, Region 1 FFE terminators not used in figure", + /* 16*/ { UNICODE_MODE | ESCAPE_MODE, -1, -1, 24, -1, "汉信码标准\015\012中国物品编码中心\015\012北京网路畅想科技发展有限公司\015\012张成海、赵楠、黄燕滨、罗秋科、王毅、张铎、王越\015\012施煜、边峥、修兴强\015\012汉信码标准\015\012中国物品编码中心\015\012北京网路畅想科技发展有限公司", -1, ZINT_WARN_NONCOMPLIANT, 69, 69, "ISO 20830 Figure 6 **NOT SAME** different encodation, Binary mode not used by figure", "111111100000101101011111111111111111111001001110010100100010001111111" "100000001100110100000000000000000010111100110000010001110101000000001" "101111100111100011100101000110011011011110011110101101001000101111101" @@ -789,7 +892,7 @@ static void test_encode(int index, int generate, int debug) { "101011101101000100011000101010101011000000111001000110111100101110101" "101011100010010010100011101010101010101010101010101010101010101110101" "000000001110010000011101101011000011001011100111111010101010000000000" - "001011001010010010110100001010101011100110101000001010011011011010101" + "001011001010010010110100001010101011100110101000001010011011011000000" "110101110101111001111100010010001010101010111011111111010100011010101" "101101010101001001011100011011101010100011111000010100101101111011010" "100101101010101100010100110001110010111010001001010101010101010101010" @@ -841,7 +944,7 @@ static void test_encode(int index, int generate, int debug) { "001001100001111001101010110100010111101000100001000100100100000000111" "010100001000010101100010001011111010100100100111010111110110001101101" "100000111101011001000100010101101000111111000001010111101110100001001" - "101010110100111101010001011011001110111111010011000110000101100110100" + "000000110100111101010001011011001110111111010011000110000101100110100" "000000000010111101100011010101010101010101010101010101010000100000000" "111111101101011001111010100000101000010101101111010100100100001110101" "000000101101001001101001011100101111001111000000110101010100101110101" @@ -851,7 +954,7 @@ static void test_encode(int index, int generate, int debug) { "111010100100111101001001010101011000001101010101010101010101100000001" "111010100010101001111111111111111010101010101010100111111111001111111" }, - /* 15*/ { UNICODE_MODE | ESCAPE_MODE, -1, 40, -1, "本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:40\015\012", 0, 101, 101, "ISO 20830 Draft Figure 7 **NOT SAME** different encodation, Binary mode not used by figure", + /* 17*/ { UNICODE_MODE | ESCAPE_MODE, -1, -1, 40, -1, "本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:40\015\012", -1, ZINT_WARN_NONCOMPLIANT, 101, 101, "ISO 20830 Figure 7 **NOT SAME** different encodation, Binary mode not used by figure", "11111110111111111111100010101000011101101011111111111111111110101100101110110110101100011000101111111" "10000000100000000000100101011001001001000000000000000000000011000001111101100010001100010100100000001" "10111110110100010100111000101101010111011101101110011000011010100101110001010110001001010010101111101" @@ -860,7 +963,7 @@ static void test_encode(int index, int generate, int debug) { "10101110110111101000100011100000001010010101101010001101001010001111001000100001101111110110001110101" "10101110000101010100110000111111110101101010110101000111100010110010010001000101111001110011101110101" "00000000111000000000110111110101101001111101010101101011010011000100101100101111000110010101100000000" - "00111100101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" + "00111100101010101010101010101010101010101010101010101010101010101010101010101010101010101010101000000" "01010101010101010100110101010101010101101000101110100000110011000101101010000010101111010100000100001" "10001101000100110010100010000000110000011011010011011001011011000011100100000110110001111011001100000" "00111110111011110000101011100010001000000000110110111110110010101010110110011011010111100010111110100" @@ -944,7 +1047,7 @@ static void test_encode(int index, int generate, int debug) { "00000011000110101010101010101011000000100100001101100001101010111110001111010001001010101001010101101" "00111001011010110000101010101010101010100011101010101010101010101010101010101010101010101010101010101" "01010101010101010100110101010101010101010101010101010101010011010101010101010101000111111011110011001" - "10101010100000010010100110100110011011111010001111111101111011010111011111110100111010101000100111100" + "00000010100000010010100110100110011011111010001111111101111011010111011111110100111010101000100111100" "00000000110000000000110101001111001001011111000010100110001010111011110011000101000111001110100000000" "11111110110001100000111101111110000101000111011100100000101010000000101111110101100100111001001110101" "00000010010110100000100110100110110000110110001111010110010011111001000101101100000100010110101110101" @@ -954,7 +1057,7 @@ static void test_encode(int index, int generate, int debug) { "11101010110101010100110101010101010101000001010101010101010011010101010101010100000101010101100000001" "11101010101010101010111111111111111111101010101010101010101011111111111111111110101010101010101111111" }, - /* 16*/ { UNICODE_MODE | ESCAPE_MODE, -1, 62, -1, "本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:40\015\012本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:40\015\012本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法RS、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 122", 0, 145, 145, "ISO 20830 Draft Figure 8 **NOT SAME** different encodation, Binary mode not used by figure", + /* 18*/ { UNICODE_MODE | ESCAPE_MODE, -1, -1, 62, -1, "本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:40\015\012本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:40\015\012本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法RS、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 122", -1, ZINT_WARN_NONCOMPLIANT, 145, 145, "ISO 20830 Figure 8 **NOT SAME** different encodation, Binary mode not used by figure", "1111111000001010101011111111111111111000011101101011001011111111111111111010111011011001101011111111111111111100111110101001101010010010101111111" "1000000001000001100000000000000000001111011000100111000000000000000000001101101011101010000000000000000000001111010010101000100011101101000000001" "1011111001100110000110100101110001001101100010010100100110110000011000101000000110000011100000011011000001001101000000001001100111010111101111101" @@ -963,7 +1066,7 @@ static void test_encode(int index, int generate, int debug) { "1010111010000001011111010110100111101101010101101011110110101000101001101110001000100010010111010101011001101100001110010000001010000011001110101" "1010111000011001100010111101000001101010011111100001001000001101111111101100101000000000001110110111100100001011111010000101101111100110101110101" "0000000010111000010011011110110111101000000101111010001010111101010001101110111100110110011110111110011101101001110000101101101010110001100000000" - "0101001011111011001010111001100111101011011111100001011100100110011100101111110010100000110000111100101111101011111100000110010010100010100010101" + "0101001011111011001010111001100111101011011111100001011100100110011100101111110010100000110000111100101111101011111100000110010010100010100000000" "1101101100001100000110111000011010101101111101010000101101000000111100001110110110101010101000111010001010101010110011110100111010101101010010001" "1010110100111000011010100110000000101001101001100000101010000110000000001001111001010001010010011011111000001101010000111110011011101010100110011" "1100001100110110101100111010011000101000011001101000011100011010011001101100010000010101000000001000011110001101010101010101010101010101010101010" @@ -1091,7 +1194,7 @@ static void test_encode(int index, int generate, int debug) { "1100000010000110001100000010010011010011001101111101001001111111101111101011101111111010001111010101000100000000010101001111001010010111110000101" "0011000101110111101001100010100011100111010001100001101101111110000101000111011100100000101010000000101111110101100100111001101011010000001101001" "1011000011011000101111010110010111100100010110110000001100010110110111100111110110000100001001000110111010010010101101011101001100100100001100110" - "1010100010001100001010011100111001000111110101110111001101110000110101010100110101100011001110010101001000000011111001110111101111110110101001010" + "0000000010001100001010011100111001000111110101110111001101110000110101010100110101100011001110010101001000000011111001110111101111110110101001010" "0000000011101001001011000110010011001001010010001111001111011010010111111111101000010110101100110111001101010010110110100010101011011111100000000" "1111111011110010001010101011010010000001001111100100001101001110111001100111001001110011101100110011111001011101100010001110101111101101001110101" "0000001001111011001110111010001101101101000001011010101111100100100110101001100011100100001110010110100111111000010111111011101000110000101110101" @@ -1101,7 +1204,7 @@ static void test_encode(int index, int generate, int debug) { "1110101000010110101111100111011100000010111011110111001101000101010111000001011011001010101011010000000110000011001001000011001101010101000000001" "1110101010101010101111111111111111101010101010101010101111111111111111101010101010101010101111111111111111101010101010101010101111111111001111111" }, - /* 17*/ { UNICODE_MODE | ESCAPE_MODE, -1, 84, -1, "本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:84\015\012本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:84\015\012本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:40本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方" "法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:84\015\012", 0, 189, 189, "ISO 20830 Draft Figure 9 **NOT SAME** different encodation, Binary mode not used by figure", + /* 19*/ { UNICODE_MODE | ESCAPE_MODE, -1, -1, 84, -1, "本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:84\015\012本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:84\015\012本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:40本标准规定了一种矩阵式二维条码——汉信码的码制以及编译码方法。本标准中对汉信码的码图方" "案、信息编码方法、纠错编译码算法、信息排布方法、参考译码算法等内容进行了详细的描述,汉信码可高效表示《GB 18030—2000 信息技术 信息交换用汉字编码字符集基本集的扩充》中的汉字信息,并具有数据容量大、抗畸变和抗污损能力强、外观美观等特点,适合于在我国各行业的广泛应用。 测试文本,测试人:施煜,边峥,修兴强,袁娲,测试目的:汉字表示,测试版本:84\015\012", -1, ZINT_WARN_NONCOMPLIANT, 189, 189, "ISO 20830 Figure 9 **NOT SAME** different encodation, Binary mode not used by figure", "111111100111111111100010101000011101011111111111111111000111101110100101111111111111111111100101100001010111111111111111101100011011101001011111111111111110100111001010010101111010101111111" "100000001000000000111000010110101000000000000000000011110111100101100000000000000000001000111110110011000000000000000000110001110111000100000000000000000010001110000000010001110110100000001" "101111100010010100101110011110110011111011110000000011110101010100001011100010110000001010100001111001101000000101101000110110001100001101001011001001110011110001101000100110111010001111101" @@ -1110,7 +1213,7 @@ static void test_encode(int index, int generate, int debug) { "101011101001111100111001000001111101110001001000100011100100001111101010001010000001101010010011111010010000001011100000100100000000001111010101000101110010111010001100011100000111101110101" "101011100001011000111100011101111011110101110110000010111000010111101010000000010011101101111010110100001101111000100000111100100110010001010111011011010011011101010100100100011110101110101" "000000001111101000111111110010010110101000010011001011001110111111111101100000101011001101101110001001001111111110001110110000101010100110111100001001001010110001001110010100100000100000000" - "011010001111110110110110001010011000001010100000111010011000101111000000101111011010001111000111010011110010100110010000100111110001010001011110001001111010100001110010000001000011001010101" + "011010001111110110110110001010011000001010100000111010011000101111000000101111011010001111000111010011110010100110010000100111110001010001011110001001111010100001110010000001000011001000000" "001111101110101100100011110101010111001111110101100011010010001011001011000111101011001011100101001111011001000000111010110000100011111010110001001101001010110001101100001100110100011011011" "000110010011010000110100001010001101100010101010110010011011010111101001110101110100001000000110010000110101000001010100101101000000010001110100000111110011000100010010101011000011100111000" "110111100011011000101100101100111001111111000101101011111011100111010011000001100010001100111011011001000100001101000000110101100011011101100101100011001011001110101010110100000110101110001" @@ -1282,7 +1385,7 @@ static void test_encode(int index, int generate, int debug) { "001010101100100110110001000001101000110011011000100010101110110111101111001010101011101011010010111000000110010100000110100000001001001101011001100010011010101011000010001101100100000000001" "001110001001110000100110110001000110010001000111110010110011000001011100111101100110001001010011001110111100011111010110111011011010010100100000001001001010000101100110010010000011101001001" "101000110011001110110100111000000111011001011011011011010111000001011101000011111000101010101100011010111110010011110010110001010010111010100111110111111010111100110000100101111001000001101" - "101010100101110000100000101111000100100011010101001011010010001100001000110000111011101111101010111000111011101110010010110110110001010010011001111001101010001011100000110011011110100010110" + "000000100101110000100000101111000100100011010101001011010010001100001000110000111011101111101010111000111011101110010010110110110001010010011001111001101010001011100000110011011110100010110" "000000001100001110111001010000001011001011000010000011100111101000000110011001111110101010000001100010111110000001000100111101110011100000010110010100100010101011111011110101000000100000000" "111111101111100110101011101111100101011100001000111011011010010110001011010100000101101111000110100111001111111011011010110111000000110010100001010101010010110100101100010100000011001110101" "000000101010100010110000100011101010110011110001100010010111100010001010111010100000101001010011111100101110101000101110110101000101000011101101110111000011100100111100110010100111101110101" @@ -1292,7 +1395,7 @@ static void test_encode(int index, int generate, int debug) { "111010101011011100110101010010111000001100010010111011010101010101010001010101010101001101010101010101000101010101010100110101010101010100010101010101010011010101010101010001010101100000001" "111010101010101010111111111111111101001010101010101011111111111111110100101010101010101111111111111111010010101010101010111111111111111101001010101010101011111111111111110100101010001111111" }, - /* 18*/ { UNICODE_MODE | ESCAPE_MODE, -1, -1, 4 << 8, "汉信码(Chinese-Sensible Code)是一种能够有效表示汉字、图像等信息的二维条码。它的主要技术特色是:1. 具有高度的汉字表示能力和汉字压缩效率。2. 信息容量大。 3. 编码范围广,可以将照片、指纹、掌纹、签字、声音、文字等凡可数字化的信息进行编码。4. 支持加密技术。5.抗污损和畸变能力强。6.修正错误能力强。7 .可供用户选择的纠错能力。8.容易制作且成本低。9.汉信码支持84个版本,可以由用户自主进行选择,最小码仅有指甲大小。10. 外形美观。", 0, 67, 67, "Previous draft Figure 1 **NOT SAME** different encodation, Binary mode not used by figure", + /* 20*/ { UNICODE_MODE | ESCAPE_MODE, -1, -1, -1, 4 << 8, "汉信码(Chinese-Sensible Code)是一种能够有效表示汉字、图像等信息的二维条码。它的主要技术特色是:1. 具有高度的汉字表示能力和汉字压缩效率。2. 信息容量大。 3. 编码范围广,可以将照片、指纹、掌纹、签字、声音、文字等凡可数字化的信息进行编码。4. 支持加密技术。5.抗污损和畸变能力强。6.修正错误能力强。7 .可供用户选择的纠错能力。8.容易制作且成本低。9.汉信码支持84个版本,可以由用户自主进行选择,最小码仅有指甲大小。10. 外形美观。", -1, ZINT_WARN_NONCOMPLIANT, 67, 67, "Previous draft Figure 1 **NOT SAME** different encodation, Binary mode not used by figure", "1111111000010101011111111111111110001011011110010101111111001111111" "1000000010000100000000000000000010100011101001010001101110000000001" "1011111001100100110100001101111011111100101010000111111111101111101" @@ -1301,7 +1404,7 @@ static void test_encode(int index, int generate, int debug) { "1010111011110000000100000101110011100011100011100011110100101110101" "1010111011000110000011001011001011110110001010100101101111001110101" "0000000000010011100110010011011011000111101101001111111101000000000" - "0010101100110010001100111111010011001110010110000110100100111010101" + "0010101100110010001100111111010011001110010110000110100100111000000" "1100010010001111111101001101001011111010010100110011001010010001100" "1110001011001110000010010100101010110010010010111010001000000101000" "1000010011000111111001000011111011101100011010010111110011110110111" @@ -1351,7 +1454,7 @@ static void test_encode(int index, int generate, int debug) { "0011011001010101001111011111001101101100101101010100101111001111110" "0001101100100101011100001110111010011110010010100100100001000101001" "1001011100010001101010010110011000110110111100000101110110000010000" - "1010101111000101011011011010010110000010111000110100011001011010100" + "0000001111000101011011011010010110000010111000110100011001011010100" "0000000001101101011110101100001101100101100001110110110111000000000" "1111111000111101000010111100100101111011111010010110011101101110101" "0000001010111001111001001100110011010101111100110100010010101110101" @@ -1361,7 +1464,7 @@ static void test_encode(int index, int generate, int debug) { "1110101001101001000100110010101000000101000110010110110110100000001" "1110101000010001111111111111111010010111110110110111111111001111111" }, - /* 19*/ { DATA_MODE, -1, -1, ZINT_FULL_MULTIBYTE, "é", 0, 23, 23, "Mask automatic (01)", + /* 21*/ { DATA_MODE, -1, -1, -1, ZINT_FULL_MULTIBYTE, "é", -1, 0, 23, 23, "Mask automatic (01)", "11111110100010101111111" "10000000001010000000001" "10111110111010001111101" @@ -1370,13 +1473,13 @@ static void test_encode(int index, int generate, int debug) { "10101110110100101110101" "10101110011101001110101" "00000000101010100000000" - "00010101101101001010101" + "00010101101101001000000" "00001011010010000111010" "10100010010010101010010" "10110101010101100010110" "10101000010110101010100" "10011111000110000101000" - "10101010000001110101000" + "00000010000001110101000" "00000000101001100000000" "11111110001000001110101" "00000010110000101110101" @@ -1386,7 +1489,7 @@ static void test_encode(int index, int generate, int debug) { "11101010001001000000001" "11101010101010101111111" }, - /* 20*/ { DATA_MODE, -1, -1, ZINT_FULL_MULTIBYTE | (1 << 8), "é", 0, 23, 23, "Mask 00", + /* 22*/ { DATA_MODE, -1, -1, -1, ZINT_FULL_MULTIBYTE | (1 << 8), "é", -1, 0, 23, 23, "Mask 00", "11111110001000001111111" "10000000111111000000001" "10111110110000001111101" @@ -1395,13 +1498,13 @@ static void test_encode(int index, int generate, int debug) { "10101110000001101110101" "10101110010111001110101" "00000000111111100000000" - "00010101100111110010101" + "00010101100111110000000" "01011110000111010010000" "00001000111000000000111" "11100000000000110111100" "00000010111100000000001" "11001010010011010000010" - "10101001101011110101000" + "00000001101011110101000" "00000000111100100000000" "11111110000010001110101" "00000010100101001110101" @@ -1411,7 +1514,7 @@ static void test_encode(int index, int generate, int debug) { "11101010011100100000001" "11101010000000001111111" }, - /* 21*/ { DATA_MODE, -1, -1, ZINT_FULL_MULTIBYTE | (4 << 8), "é", 0, 23, 23, "Mask 11", + /* 23*/ { DATA_MODE, -1, -1, -1, ZINT_FULL_MULTIBYTE | (4 << 8), "é", -1, 0, 23, 23, "Mask 11", "11111110000101101111111" "10000000111000100000001" "10111110110000101111101" @@ -1420,13 +1523,13 @@ static void test_encode(int index, int generate, int debug) { "10101110100110001110101" "10101110101110101110101" "00000000111000000000000" - "00010101100000111010101" + "00010101100000111000000" "01000100011111101010111" "10010010100111000111100" "00100101101111110000100" "01000111010010111000110" "00001101111110010111010" - "10101011111001110101000" + "00000011111001110101000" "00000000001110100000000" "11111110110000101110101" "00000010001000101110101" @@ -1436,7 +1539,7 @@ static void test_encode(int index, int generate, int debug) { "11101010100110100000001" "11101010111010001111111" }, - /* 22*/ { DATA_MODE, -1, -1, ZINT_FULL_MULTIBYTE | (5 << 8), "é", 0, 23, 23, "Mask > 11 ignored", + /* 24*/ { DATA_MODE, -1, -1, -1, ZINT_FULL_MULTIBYTE | ((4 + 1) << 8), "é", -1, 0, 23, 23, "Mask > 11 ignored", "11111110100010101111111" "10000000001010000000001" "10111110111010001111101" @@ -1445,13 +1548,13 @@ static void test_encode(int index, int generate, int debug) { "10101110110100101110101" "10101110011101001110101" "00000000101010100000000" - "00010101101101001010101" + "00010101101101001000000" "00001011010010000111010" "10100010010010101010010" "10110101010101100010110" "10101000010110101010100" "10011111000110000101000" - "10101010000001110101000" + "00000010000001110101000" "00000000101001100000000" "11111110001000001110101" "00000010110000101110101" @@ -1461,12 +1564,1616 @@ static void test_encode(int index, int generate, int debug) { "11101010001001000000001" "11101010101010101111111" }, + /* 25*/ { UNICODE_MODE, 3, 2, -1, 2 << 8, "sn:7QPB4MN", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 3 Example 1 same with explicit mask 01 (auto 11)", + "11111110011010101111111" + "10000000010101100000001" + "10111110001010001111101" + "10100000110110100000101" + "10101110001110001110101" + "10101110110101101110101" + "10101110001100001110101" + "00000000101110000000000" + "00010101001010100000000" + "01010110101101010100000" + "01100011010101010010011" + "00000110111001011111100" + "11001111110100100001101" + "01100101110111101110100" + "00000000111000010101000" + "00000000001001100000000" + "11111110000011001110101" + "00000010101010101110101" + "11111010010011001110101" + "00001010111111100000101" + "11101010001010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 26*/ { UNICODE_MODE, 3, -1, -1, -1, "price:£20.00", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 3 Example 2 same", + "11111110011010101111111" + "10000000010100100000001" + "10111110010010001111101" + "10100000100110100000101" + "10101110001101001110101" + "10101110110101101110101" + "10101110000010001110101" + "00000000110101000000000" + "00010101011010100000000" + "01011001001101010100010" + "10010011000100111001010" + "11101111000010101100010" + "11000110010011100000110" + "01011010111111101011101" + "00000000101001010101000" + "00000000010011100000000" + "11111110001110001110101" + "00000010111100101110101" + "11111010001001001110101" + "00001010110001100000101" + "11101010001110001111101" + "11101010110100000000001" + "11101010101010001111111" + }, + /* 27*/ { UNICODE_MODE, 3, -1, -1, 2 << 8, "C:\\DOCS\\EXAMPLE.TXT", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 3 Example 3 same with explicit mask 01 (auto 11)", + "1111111011101010001111111" + "1000000001110000000000001" + "1011111011111110001111101" + "1010000000000110000000101" + "1010111000111001101110101" + "1010111011000001001110101" + "1010111001000100101110101" + "0000000011100110100000000" + "0001011000000011011000000" + "1000101010100000100010100" + "0111000110011110000000011" + "0110011010100100100110110" + "1010100111110011001011000" + "0111010100110110111011111" + "0100110110010101101001011" + "1110100011110101010101010" + "0000001100101101001101000" + "0000000010110101100000000" + "1111111010101101001110101" + "0000001000011001101110101" + "1111101011011110001110101" + "0000101001010101000000101" + "1110101000100011101111101" + "1110101001101100000000001" + "1110101000001010101111111" + }, + /* 28*/ { UNICODE_MODE, 4, 2, 3, 2 << 8, "Študentska št. 2198390", -1, 0, 27, 27, "AIM ITS/04-023:2022 ECI 4 Example 1 **NOT SAME** different encodation, example Binary only, Zint uses Numeric also", + "111111100110101010001111111" + "100000000101110001100000001" + "101111100010101110101111101" + "101000000111000001000000101" + "101011100011001010001110101" + "101011101000010101001110101" + "101011100010111110001110101" + "000000001001010101100000000" + "000101110100111100110000000" + "010101001110000110101110000" + "101110101010011001101110000" + "111011011101010101111010000" + "001001101010101010101010011" + "101000000010011000110101010" + "010011111000100111010000101" + "010101110111110000001100100" + "101110111111000101110110011" + "010101110101100000100100000" + "000000011011010101011101000" + "000000001011110110100000000" + "111111100111001101001110101" + "000000100111001110101110101" + "111110100110101010001110101" + "000010100101010000000000101" + "111010101001110010001111101" + "111010101101010011000000001" + "111010100010001010001111111" + }, + /* 29*/ { UNICODE_MODE, 4, 2, 5, 2 << 8, "Szczegółowe dane kontaktowe:+48 22 694 60 00", -1, 0, 31, 31, "AIM ITS/04-023:2022 ECI 4 Example 2 **NOT SAME** example corrupt??", + "1111111011101010101001001111111" + "1000000010001000010011100000001" + "1011111011011100100101101111101" + "1010000010010100011010000000101" + "1010111010000010111111001110101" + "1010111011000111011000101110101" + "1010111000111001111111101110101" + "0000000010100110011100100000000" + "0001100101001100101100101000000" + "1110111011110100011111011100110" + "1010011100110010011001000110101" + "1100110111101110101101111010000" + "1000011100001101011011000100000" + "1111110111100110010001000001010" + "1110110110110000010100001110110" + "1100110101001101001111100110000" + "1111111111111110101001110010101" + "0000000000000010100101001111000" + "1110001010001010011100001010001" + "0101010100110011101000101110111" + "0000101001101010101011010001000" + "1000111001101011000100111001001" + "0000001011011011100011010011000" + "0000000010001011100100100000000" + "1111111011101011101110001110101" + "0000001010111010111111101110101" + "1111101001001011010001101110101" + "0000101000010010001111100000101" + "1110101010101011000110101111101" + "1110101011111011001010100000001" + "1110101001101011111111101111111" + }, + /* 30*/ { UNICODE_MODE, 5, 2, -1, 2 << 8, "Liĥtenŝtejno", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 5 Example 1 **NOT SAME** example uses Binary only, Zint uses Text mode also", + "11111110011010101111111" + "10000000010111100000001" + "10111110010110001111101" + "10100000110000100000101" + "10101110001101001110101" + "10101110101100101110101" + "10101110000010001110101" + "00000000110101000000000" + "00010101010101100000000" + "01010010000101010101100" + "10011100000111100111111" + "11101000110011110010000" + "00100111011111100000011" + "10001101101110111010110" + "00000000110100010101000" + "00000000010010100000000" + "11111110011011001110101" + "00000010110011101110101" + "11111010010100001110101" + "00001010101001100000101" + "11101010010000001111101" + "11101010110000000000001" + "11101010101010001111111" + }, + /* 31*/ { UNICODE_MODE, 6, 2, -1, -1, "Lietuvą", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 6 Example 1 same", + "11111110011010101111111" + "10000000010101100000001" + "10111110001010001111101" + "10100000110011100000101" + "10101110001110001110101" + "10101110110101101110101" + "10101110001000001110101" + "00000000100011000000000" + "00010101001010100000000" + "01001100000101010101001" + "11011110100001001001111" + "01110001101010111111001" + "10011000100110101010100" + "11101111001110010001110" + "00000000101110010101000" + "00000000010111100000000" + "11111110000000001110101" + "00000010110101101110101" + "11111010001010001110101" + "00001010110011100000101" + "11101010000010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 32*/ { UNICODE_MODE, 7, 2, -1, -1, "Россия", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 7 Example 1 **NOT SAME** different encodation, figure uses Region 1", + "11111110011010101111111" + "10000000010101100000001" + "10111110001010001111101" + "10100000110010100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010011100101010101010" + "11001011101001011101000" + "11110101001011011101110" + "10010011000001011011010" + "11101111101001011011110" + "00000000101010010101000" + "00000000010100100000000" + "11111110001010001110101" + "00000010110101101110101" + "11111010001011001110101" + "00001010111010100000101" + "11101010001010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 33*/ { UNICODE_MODE, 7, 2, -1, -1, "Монголулс", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 7 Example 2 same", + "11111110011010101111111" + "10000000010101100000001" + "10111110001010001111101" + "10100000110010100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01011100111101010100100" + "11000101001001011100101" + "00011010001000011010100" + "11010000110101010111000" + "11101100111010111000110" + "00000000101001010101000" + "00000000001110100000000" + "11111110001010001110101" + "00000010101000101110101" + "11111010010100001110101" + "00001010110001100000101" + "11101010010010001111101" + "11101010111101000000001" + "11101010101010001111111" + }, + /* 34*/ { UNICODE_MODE, 8, 2, -1, 4 << 8, "جواز السفر", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 8 Example 1 same with explicit mask 11 (auto 01)", + "11111110111101101111111" + "10000000100101000000001" + "10111110000100101111101" + "10100000110000100000101" + "10101110111110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100111100000000" + "00010101000111010000000" + "00010000101000111000001" + "11100100100110000001100" + "00000100010010010100110" + "00000001000101111001010" + "01010101110010100010001" + "00000001010110010101000" + "00000000101000100000000" + "11111110110001101110101" + "00000010000100101110101" + "11111010010010101110101" + "00001010111111100000101" + "11101010101010001111101" + "11101010010100100000001" + "11101010111010101111111" + }, + /* 35*/ { UNICODE_MODE, 8, 2, -1, 3 << 8, "المنشأ: المملكة العربية السعودية", -1, 0, 29, 29, "AIM ITS/04-023:2022 ECI 8 Example 2 **NOT SAME** example corrupt??", + "11111110011000101001101111111" + "10000000100000000011100000001" + "10111110010110110011101111101" + "10100000001111011100100000101" + "10101110110000100010101110101" + "10101110010100001111001110101" + "10101110100101110100101110101" + "00000000101000111000000000000" + "00011000011111011010001000000" + "10111010110101111010001000101" + "10000011101101000000111100011" + "10001110000101100001010011001" + "11101110011011010101110111001" + "11000110011000100010110101000" + "11111111111111110101000111001" + "00000000000000111111000110100" + "10011011011100110001110111100" + "01100110101000110101101111100" + "01110000111010101101010100100" + "11110101000110111100100100100" + "00000010000110111111000011000" + "00000000000100100001100000000" + "11111110111000100100101110101" + "00000010011110110001001110101" + "11111010101010110110101110101" + "00001010101110101001000000101" + "11101010100100110000001111101" + "11101010100000110001100000001" + "11101010100100111111001111111" + }, + /* 36*/ { UNICODE_MODE, 9, 1, -1, -1, "Μέρος #. α123", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 9 Example 1 **NOT SAME** example uses Binary only, Zint uses Numeric mode also", + "11111110011010001111111" + "10000000110101100000001" + "10111110001110101111101" + "10100000111100100000101" + "10101110001101101110101" + "10101110110110001110101" + "10101110010010001110101" + "00000000010101100000000" + "00010101000101011000000" + "10111111100010100101100" + "11001010101001000101101" + "01010001001011010101011" + "01010110101010001110110" + "01101001010101101001101" + "00000011001001010101000" + "00000000110010000000000" + "11111110011111001110101" + "00000010010010101110101" + "11111010101001001110101" + "00001010100101100000101" + "11101010101010001111101" + "11101010110010100000001" + "11101010001010001111111" + }, + /* 37*/ { UNICODE_MODE, 10, 2, -1, -1, "דרכון", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 10 Example 1 same", + "11111110011010101111111" + "10000000010101100000001" + "10111110001010001111101" + "10100000111111100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010000101101010101011" + "01010101111101101101110" + "00101111101010010110110" + "00010111101001110100100" + "11111011010101001001111" + "00000000101010010101000" + "00000000010110100000000" + "11111110011000001110101" + "00000010100101101110101" + "11111010001011001110101" + "00001010111011100000101" + "11101010001010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 38*/ { UNICODE_MODE, 10, 2, 3, -1, "מספר חלק: A20200715001", -1, 0, 27, 27, "AIM ITS/04-023:2022 ECI 10 Example 2 **NOT SAME** example uses Binary only, Zint uses Numeric mode also", + "111111100110010010101111111" + "100000000001000001000000001" + "101111100111111110001111101" + "101000001000101000100000101" + "101011100000101000001110101" + "101011100111111111101110101" + "101011101011110001101110101" + "000000001101001001000000000" + "000101110011001101111000000" + "010010010011111000101100110" + "001001001001011000011110010" + "011000110111111111011011001" + "011101011001010010010011101" + "101100000111001001001001001" + "001111110011111000000000111" + "010010100100110010101100010" + "000010111000110110000110111" + "111111100101001101000011001" + "000000111001110010011101000" + "000000000001010101100000000" + "111111101011101100101110101" + "000000101100101011001110101" + "111110100001001000001110101" + "000010101101110100100000101" + "111010100000011010001111101" + "111010100001001101000000001" + "111010101001111111001111111" + }, + /* 39*/ { UNICODE_MODE, 11, 2, 3, -1, "Amerika Birleşik Devletleri", -1, 0, 27, 27, "AIM ITS/04-023:2022 ECI 11 Example 1 **NOT SAME** example uses 2-byte Region mode", + "111111100110101011001111111" + "100000000110110010100000001" + "101111100000100000101111101" + "101000000110101110000000101" + "101011100011101100001110101" + "101011101011111110001110101" + "101011100000001101001110101" + "000000001101111110100000000" + "000101110011001111110000000" + "011010101010010101000000101" + "010100101010101111101001111" + "110011110101010101011101000" + "011000000111111010101010101" + "001010000110011101010101010" + "001001001001010110001000101" + "010100111110010011010101111" + "111110001011001100101011111" + "011011010100101011010110011" + "000000011010110001011101000" + "000000001010100110100000000" + "111111100110001100001110101" + "000000100101110100101110101" + "111110100000100111001110101" + "000010100001000101000000101" + "111010101100001101001111101" + "111010101000101000000000001" + "111010100111001010001111111" + }, + /* 40*/ { UNICODE_MODE, 11, 2, 3, -1, "Biniş kartı #120921039", -1, 0, 27, 27, "AIM ITS/04-023:2022 ECI 11 Example 2 **NOT SAME** example uses Binary only, Zint uses Numeric mode also", + "111111100110101011001111111" + "100000000111001001100000001" + "101111100010101101101111101" + "101000000111101110000000101" + "101011100011010111001110101" + "101011101100010101001110101" + "101011100011101010001110101" + "000000001001010101100000000" + "000101110010101000110000000" + "010101001010010110000001011" + "001010101010000001111011100" + "100100101101010101000110111" + "100001101101101010101001101" + "110110110010110001010101010" + "101111101110010111100101101" + "010100000111001011011010101" + "010011001011101011101010010" + "010101001110111101110011111" + "000000011111001010011101000" + "000000001101010001100000000" + "111111100100101101001110101" + "000000100101011110101110101" + "111110100010101010001110101" + "000010100011100011000000101" + "111010101000110010001111101" + "111010101101011000000000001" + "111010100010101010001111111" + }, + /* 41*/ { UNICODE_MODE, 12, 2, -1, 2 << 8, "Kūrybiškumą", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 12 Example 1 same with explicit mask 01 (auto 10)", + "11111110011010101111111" + "10000000010100100000001" + "10111110011100001111101" + "10100000101001100000101" + "10101110001101001110101" + "10101110110111101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01011110000101010101111" + "01110101010101011001000" + "01010001110011100000101" + "10000100000010101110011" + "00010111110011110111100" + "00000000110000010101000" + "00000000011000100000000" + "11111110000000001110101" + "00000010110000101110101" + "11111010011100001110101" + "00001010101011100000101" + "11101010010111001111101" + "11101010111110000000001" + "11101010101010001111111" + }, + /* 42*/ { UNICODE_MODE, 13, 2, -1, -1, "บาร๋แค่ด", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 13 Example 1 **NOT SAME** example uses Region 1", + "11111110011010101111111" + "10000000010101100000001" + "10111110001010001111101" + "10100000111000100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01011101111101010100111" + "11000010011100111100100" + "01101101101010101111111" + "11010111111110101001111" + "01110101000110110001110" + "00000000100010010101000" + "00000000000001100000000" + "11111110000100001110101" + "00000010101111101110101" + "11111010001011001110101" + "00001010101101100000101" + "11101010010010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 43*/ { UNICODE_MODE, 15, 2, -1, -1, "uzņēmums", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 15 Example 1 same", + "11111110011010101111111" + "10000000010101100000001" + "10111110001010001111101" + "10100000111010100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01011101001101010100000" + "00011011100001111101110" + "11011001111010111010010" + "01000101000000110000010" + "11000000000000101001101" + "00000000100111010101000" + "00000000011001100000000" + "11111110011010001110101" + "00000010101100101110101" + "11111010011011001110101" + "00001010100110100000101" + "11101010000010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 44*/ { UNICODE_MODE, 16, 2, -1, -1, "ṁórṡáċ", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 16 Example 1 same with explicit mask 11 (auto 10)", + "11111110011001001111111" + "10000000000000000000001" + "10111110011111101111101" + "10100000001001000000101" + "10101110000010001110101" + "10101110011111001110101" + "10101110101001101110101" + "00000000100100100000000" + "00010101011111101000000" + "01001111100001001000011" + "11011111001010111111110" + "10011011010101010101000" + "10110111010001001010010" + "11111000110000111101001" + "00000010111111010101000" + "00000000101001100000000" + "11111110100111101110101" + "00000010011111001110101" + "11111010001000001110101" + "00001010001100000000101" + "11101010101111001111101" + "11101010001001000000001" + "11101010000100001111111" + }, + /* 45*/ { UNICODE_MODE, 17, -1, -1, 2 << 8, "Price: €13.50", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 17 Example 1 same with explicit mask 01 (auto 10)", + "11111110011010101111111" + "10000000010011100000001" + "10111110000110001111101" + "10100000100100100000101" + "10101110001100001110101" + "10101110101001101110101" + "10101110000010001110101" + "00000000110101000000000" + "00010101011111100000000" + "01111000000001010100010" + "10010100011100111001100" + "10010111000010001010110" + "11000100111100100000110" + "00010010111101100110110" + "00000000101010010101000" + "00000000000011100000000" + "11111110001010001110101" + "00000010100111101110101" + "11111010001000001110101" + "00001010111100100000101" + "11101010011110001111101" + "11101010111100000000001" + "11101010101010001111111" + }, + /* 46*/ { UNICODE_MODE, 18, -1, -1, -1, "Te słowa są głębokie", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 18 Example 1 **NOT SAME** example uses Binary only, Zint uses Text mode also", + "1111111001000000101111111" + "1000000011100111000000001" + "1011111010111110001111101" + "1010000010100010100000101" + "1010111010011000101110101" + "1010111001000101001110101" + "1010111000011110101110101" + "0000000010000000100000000" + "0001011000000001100000000" + "1001101110111101000111101" + "0110011010100011100111111" + "0111010001010011110100100" + "0100110000001101001011001" + "0010010011101100101011111" + "0100100110111101011010001" + "0000111101101010001010001" + "0000000010110111001101000" + "0000000010111111100000000" + "1111111011000000001110101" + "0000001000000000001110101" + "1111101010010010101110101" + "0000101010000000100000101" + "1110101000000001101111101" + "1110101001010000100000001" + "1110101011100000001111111" + }, + /* 47*/ { UNICODE_MODE, 20, -1, -1, -1, "バーコード", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 20 Example 1 **NOT SAME** example uses 2-byte Region mode", + "11111110011010101111111" + "10000000010000100000001" + "10111110001010001111101" + "10100000110001100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01011111110101010101011" + "00010111001011010110100" + "01100101000001111001101" + "11011011010000101100000" + "00011110011111011101111" + "00000000101011010101000" + "00000000011111100000000" + "11111110011000001110101" + "00000010101000101110101" + "11111010010010001110101" + "00001010100001100000101" + "11101010010010001111101" + "11101010101110000000001" + "11101010101010001111111" + }, + /* 48*/ { UNICODE_MODE, 20, -1, -1, -1, "東京都", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 20 Example 2 **NOT SAME** example uses 2-byte Region mode", + "11111110111010001111111" + "10000000110000000000001" + "10111110100100101111101" + "10100000110001000000101" + "10101110001101001110101" + "10101110110111001110101" + "10101110000010001110101" + "00000000010101000000000" + "00010101111001110000000" + "01110011110011001010011" + "01101110110011001110101" + "10010111101100111000001" + "01111011101110001100010" + "01010100011001011011011" + "00000001101010110101000" + "00000000010110000000000" + "11111110000101001110101" + "00000010010101101110101" + "11111010001011001110101" + "00001010000010100000101" + "11101010111010101111101" + "11101010010101100000001" + "11101010001010101111111" + }, + /* 49*/ { UNICODE_MODE, 21, -1, -1, -1, "Študentska št. 2198390", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 21 Example 1 **NOT SAME** different encodation, example Binary only, Zint uses Numeric also", + "1111111001000000101111111" + "1000000011000010000000001" + "1011111010111101001111101" + "1010000010000101100000101" + "1010111010011000101110101" + "1010111000010010001110101" + "1010111000100000101110101" + "0000000010000000100000000" + "0001011001101001100000000" + "1110101110111110010100001" + "1111010001010011011100011" + "0011001101000110000000000" + "0001011010101110011011100" + "0001100100011011110100011" + "0010001010110011100011000" + "0010111001100000001110110" + "0000000011010100001101000" + "0000000010111111100000000" + "1111111011110011001110101" + "0000001001010110001110101" + "1111101010110111101110101" + "0000101010000000100000101" + "1110101000101101101111101" + "1110101001011010100000001" + "1110101010000000001111111" + }, + /* 50*/ { UNICODE_MODE, 22, 2, -1, -1, "Россия", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 22 Example 1 same", + "11111110011010101111111" + "10000000010001100000001" + "10111110001010001111101" + "10100000110011100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010011100101010100010" + "11010000100111011101011" + "01101001001010111101000" + "10010110010001111011010" + "11010000101001001110110" + "00000000101010010101000" + "00000000010101100000000" + "11111110010010001110101" + "00000010100101101110101" + "11111010001010001110101" + "00001010100100100000101" + "11101010011010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 51*/ { UNICODE_MODE, 22, 2, -1, 4 << 8, "Монголулс", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 22 Example 1 same with explicit mask 11 (auto 01)", + "11111110111101101111111" + "10000000100011000000001" + "10111110000000101111101" + "10100000111110100000101" + "10101110111110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100111100000000" + "00010101000111010000000" + "00010011101000111000001" + "11101101011010110000110" + "00100110110000100110100" + "00111010101011100101000" + "10111001000010101001100" + "00000001000001010101000" + "00000000101111100000000" + "11111110111100101110101" + "00000010001000101110101" + "11111010010010101110101" + "00001010111110100000101" + "11101010111110001111101" + "11101010010010100000001" + "11101010111010101111111" + }, + /* 52*/ { UNICODE_MODE, 23, 2, -1, 4 << 8, "bœuf", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 23 Example 1 same with explicit mask 11 (auto 01)", + "11111110111101101111111" + "10000000100011000000001" + "10111110000000101111101" + "10100000111111100000101" + "10101110111110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100111100000000" + "00010101000111010000000" + "00011110000000111000110" + "11010001010000100100101" + "01010000111001110101100" + "10000101100110111000111" + "10010101101101000010101" + "00000001010010010101000" + "00000000110001100000000" + "11111110100001101110101" + "00000010001101101110101" + "11111010001100101110101" + "00001010101010100000101" + "11101010101010001111101" + "11101010011010100000001" + "11101010111010101111111" + }, + /* 53*/ { UNICODE_MODE, 24, -1, -1, -1, "جواز السفر", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 24 Example 1 same", + "11111110011010101111111" + "10000000010011100000001" + "10111110001110001111101" + "10100000111101100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01011111100101010101100" + "11011100000110011100110" + "00000100101000111100000" + "11101101011101101011001" + "10001111001010111010010" + "00000000101011010101000" + "00000000001110100000000" + "11111110000011001110101" + "00000010101100101110101" + "11111010010110001110101" + "00001010100010100000101" + "11101010011101001111101" + "11101010111011000000001" + "11101010101010001111111" + }, + /* 54*/ { UNICODE_MODE, 24, 2, -1, 4 << 8, "المنشأ: المملكة العربية السعودية", -1, 0, 29, 29, "AIM ITS/04-023:2022 ECI 24 Example 2 **NOT SAME** example corrupt??", + "11111110111100101100001111111" + "10000000000110001000100000001" + "10111110001001001000101111101" + "10100000101110010100000000101" + "10101110011100000000101110101" + "10101110100000110111001110101" + "10101110110100010001101110101" + "00000000110101010111000000000" + "00011000000111100011110000000" + "11101001100100010100111001011" + "10010100011100101100010100000" + "10111010010101011001101010010" + "11001010111100100101100111010" + "11100110010001000001001010100" + "11111111111111101011011111101" + "00000000000000111110110111000" + "00101111100100110110010100000" + "11110110100010101001111111011" + "01110101111110101010111010001" + "00010110101110110101000111100" + "00000001101000100010000011000" + "00000000010110111010100000000" + "11111110100110110010101110101" + "00000010000110110010101110101" + "11111010100110110010001110101" + "00001010001010110001100000101" + "11101010111110101011001111101" + "11101010111110110010000000001" + "11101010011000111111101111111" + }, + /* 55*/ { UNICODE_MODE, 25, 2, -1, -1, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 25 Example 1 same", + "11111110011010101111111" + "10000000010001100000001" + "10111110001010001111101" + "10100000111100100000101" + "10101110001110001110101" + "10101110110101101110101" + "10101110001111001110101" + "00000000111111000000000" + "00010101001010100000000" + "01011100100101010100101" + "01001100010110101101010" + "01000010110100011111110" + "10101011110111101010101" + "10011011010101010011010" + "00000000101010010101000" + "00000000010110100000000" + "11111110010010001110101" + "00000010100101101110101" + "11111010001011001110101" + "00001010111101100000101" + "11101010011010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 56*/ { UNICODE_MODE, 25, 2, -1, 3 << 8, "バーコード", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 25 Example 2 same with explicit mask 10 (auto 01)", + "11111110011001001111111" + "10000000000001000000001" + "10111110011011101111101" + "10100000000000000000101" + "10101110000010001110101" + "10101110011111001110101" + "10101110101001101110101" + "00000000100100100000000" + "00010101011111101000000" + "01000011000001001000001" + "01000100001010100101101" + "00101011110000010011100" + "11001101110000101000010" + "10100011101000011101100" + "00000010101111010101000" + "00000000110100100000000" + "11111110101100101110101" + "00000010000001001110101" + "11111010001011001110101" + "00001010010001000000101" + "11101010100011001111101" + "11101010001111000000001" + "11101010000100001111111" + }, + /* 57*/ { UNICODE_MODE, 25, 2, -1, -1, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 25 Example 3 same", + "11111110111101101111111" + "10000000100011000000001" + "10111110000000101111101" + "10100000110001100000101" + "10101110111110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100111100000000" + "00010101000111010000000" + "00011100110000111001001" + "10010001101101100001010" + "00000110011010011110010" + "11010011101001010001011" + "01110110011101000101111" + "00000001010010010101000" + "00000000110010100000000" + "11111110101100101110101" + "00000010011101101110101" + "11111010001101101110101" + "00001010100001100000101" + "11101010110010001111101" + "11101010011010100000001" + "11101010111010101111111" + }, + /* 58*/ { UNICODE_MODE, 26, 2, -1, -1, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 26 Example 1 **NOT SAME** example uses 2-byte Region mode", + "11111110111101101111111" + "10000000100011000000001" + "10111110000000101111101" + "10100000110010100000101" + "10101110111110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100111100000000" + "00010101000111010000000" + "00011100100000111000100" + "11010111111100101010011" + "00100101110001101011100" + "10110011001100111001110" + "11110111101001011011011" + "00000001010010010101000" + "00000000110010100000000" + "11111110100001101110101" + "00000010011101101110101" + "11111010001100101110101" + "00001010100010100000101" + "11101010100010001111101" + "11101010011010100000001" + "11101010111010101111111" + }, + /* 59*/ { UNICODE_MODE, 26, 2, -1, 4 << 8, "バーコード", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 26 Example 2 same with explicit mask 11 (auto 01)", + "1111111001110110001111111" + "1000000011011011100000001" + "1011111010000100101111101" + "1010000001001001000000101" + "1010111011111000101110101" + "1010111011101011101110101" + "1010111011010000001110101" + "0000000010011100000000000" + "0001011001101111101000000" + "1001110101011100000000000" + "0001111101100000011010101" + "0111100110000100111000011" + "1101001110100111100011110" + "1010011101010100011101110" + "0101000110011010011101100" + "0000110010101001100100011" + "0000001011001010001101000" + "0000000001110110100000000" + "1111111000110101101110101" + "0000001011000010101110101" + "1111101011100011101110101" + "0000101001101001000000101" + "1110101010100110101111101" + "1110101011110011100000001" + "1110101001010110001111111" + }, + /* 60*/ { UNICODE_MODE, 26, 2, -1, -1, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 26 Example 3 same", + "11111110111101101111111" + "10000000100011000000001" + "10111110000000101111101" + "10100000110010100000101" + "10101110111110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100111100000000" + "00010101000111010000000" + "00010011100000111000010" + "01000110110001000011011" + "00111000100000111100001" + "11010011001010000011111" + "11001010111110101001011" + "00000001011001010101000" + "00000000100001100000000" + "11111110111010101110101" + "00000010010100101110101" + "11111010010100101110101" + "00001010101111100000101" + "11101010101101001111101" + "11101010011010100000001" + "11101010111010101111111" + }, + /* 61*/ { UNICODE_MODE, 27, 2, -1, 3 << 8, "sn:7QPB4MN", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 27 Example 1 same with explicit mask 10 (auto 11)", + "11111110011001001111111" + "10000000000000000000001" + "10111110011111101111101" + "10100000000010000000101" + "10101110000000001110101" + "10101110011111001110101" + "10101110101111101110101" + "00000000111111100000000" + "00010101011111101000000" + "01001010110001001000011" + "11100001011011011100101" + "11001100010011101001101" + "00101100011010000010001" + "01011110000110001100110" + "00000010101101010101000" + "00000000110110100000000" + "11111110110101101110101" + "00000010000000001110101" + "11111010010001001110101" + "00001010000001000000101" + "11101010101111001111101" + "11101010001001000000001" + "11101010000100001111111" + }, + /* 62*/ { UNICODE_MODE, 28, 2, -1, -1, "條碼", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 28 Example 1 same", + "11111110011010101111111" + "10000000010001100000001" + "10111110001010001111101" + "10100000111001100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010001111101010100010" + "01011000111101101111111" + "00010010000000001010101" + "10101001011010101010101" + "01100111010101011001010" + "00000000101010010101000" + "00000000010111100000000" + "11111110011010001110101" + "00000010100101101110101" + "11111010001010001110101" + "00001010111011100000101" + "11101010011010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 63*/ { UNICODE_MODE, 29, 2, -1, -1, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 29 Example 1 **NOT SAME** example uses Region 1 mode", + "11111110011010101111111" + "10000000010001100000001" + "10111110001010001111101" + "10100000111000100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010001100101010101100" + "11011111110100000100011" + "00110101111011110100111" + "11001011011001101010100" + "10110111010101000100100" + "00000000101010010101000" + "00000000010101100000000" + "11111110000010001110101" + "00000010110101101110101" + "11111010001011001110101" + "00001010111110100000101" + "11101010000010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 64*/ { UNICODE_MODE, 29, 2, -1, -1, "北京", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 29 Example 2 **NOT SAME** example uses Region 1 mode", + "11111110011010101111111" + "10000000010001100000001" + "10111110001010001111101" + "10100000111000100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010001111101010100010" + "01111010001100100111001" + "01011010111110000010111" + "10001011100010101010100" + "01011111010101000110101" + "00000000101010010101000" + "00000000010110100000000" + "11111110001001001110101" + "00000010110101101110101" + "11111010001011001110101" + "00001010100110100000101" + "11101010010010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 65*/ { UNICODE_MODE, 30, 2, -1, -1, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 30 Example 1 **NOT SAME** example uses Region 1 mode", + "11111110011010101111111" + "10000000010001100000001" + "10111110001010001111101" + "10100000111011100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010011111101010100110" + "01001111011001100100100" + "11011100011000100010101" + "11111111001110000001010" + "01111101000001011100010" + "00000000101010010101000" + "00000000010101100000000" + "11111110001111001110101" + "00000010100101101110101" + "11111010001011001110101" + "00001010100001100000101" + "11101010010010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 66*/ { UNICODE_MODE, 30, 2, -1, -1, "서울", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 30 Example 2 **NOT SAME** example uses Region 1 mode", + "11111110011010101111111" + "10000000010001100000001" + "10111110001010001111101" + "10100000111011100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010001111101010100100" + "11110001000111000111110" + "10111010101011100100011" + "01001011010111101010100" + "00111111010101000101101" + "00000000101010010101000" + "00000000010100100000000" + "11111110010100001110101" + "00000010100101101110101" + "11111010001010001110101" + "00001010101011100000101" + "11101010000010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 67*/ { UNICODE_MODE, 31, 2, -1, -1, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 31 Example 1 **NOT SAME** example uses Region 1 mode", + "11111110011010101111111" + "10000000010001100000001" + "10111110001010001111101" + "10100000111010100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010001100101010101100" + "11010000010000000100100" + "11111101111010110010011" + "11001010010100101010100" + "00111011010101001010101" + "00000000101010010101000" + "00000000010101100000000" + "11111110010111001110101" + "00000010100101101110101" + "11111010001011001110101" + "00001010100111100000101" + "11101010010010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 68*/ { UNICODE_MODE, 31, 2, -1, -1, "北京", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 31 Example 2 **NOT SAME** example uses Region 1 mode", + "11111110011001001111111" + "10000000000000000000001" + "10111110011111101111101" + "10100000000110000000101" + "10101110000010001110101" + "10101110011111001110101" + "10101110101001101110101" + "00000000100100100000000" + "00010101011111101000000" + "01001101100001001000001" + "11111011100110101001111" + "00111000010101101110110" + "01101001001100001001000" + "10100010100100111001010" + "00000010111111010101000" + "00000000101010100000000" + "11111110110010101110101" + "00000010001111001110101" + "11111010001000001110101" + "00001010001110000000101" + "11101010110111001111101" + "11101010001001000000001" + "11101010000100001111111" + }, + /* 69*/ { UNICODE_MODE, 31, 2, -1, -1, "條碼", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 31 Example 3 **NOT SAME** example uses 2-byte Region mode", + "11111110011001001111111" + "10000000000000000000001" + "10111110011111101111101" + "10100000000110000000101" + "10101110000010001110101" + "10101110011111001110101" + "10101110101001101110101" + "00000000100100100000000" + "00010101011111101000000" + "01001101101001001000010" + "10011010011001000001111" + "01010010111001010010011" + "01101000101111001001000" + "00100100100100101100100" + "00000010111111010101000" + "00000000101011100000000" + "11111110110011101110101" + "00000010001111001110101" + "11111010001000001110101" + "00001010010101000000101" + "11101010101111001111101" + "11101010001001000000001" + "11101010000100001111111" + }, + /* 70*/ { UNICODE_MODE, 32, 2, -1, 2 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 1 same with explicit mask 01 (auto 10)", + "11111110011010101111111" + "10000000011101100000001" + "10111110001010001111101" + "10100000110101100000101" + "10101110000010001110101" + "10101110110101101110101" + "10101110001111001110101" + "00000000111100000000000" + "00010101001010100000000" + "01001101100101010100100" + "11001100001101010101110" + "10000010110100001100110" + "10101010111000101010100" + "10110111010101010101110" + "00000000101010010101000" + "00000000010101100000000" + "11111110000100001110101" + "00000010100101101110101" + "11111010001010001110101" + "00001010100110100000101" + "11101010010010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 71*/ { UNICODE_MODE, 32, 2, -1, 4 << 8, "北京", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 2 same with explicit mask 11 (auto 01)", + "11111110111101101111111" + "10000000101111000000001" + "10111110000000101111101" + "10100000111000100000101" + "10101110110000001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100001100000000" + "00010101000111010000000" + "00000110110000111000101" + "01010010100000111000001" + "11000010001111000000000" + "01000111001001111000110" + "11101011101101010111010" + "00000001010010010101000" + "00000000110010100000000" + "11111110111000101110101" + "00000010011101101110101" + "11111010001100101110101" + "00001010101001100000101" + "11101010110010001111101" + "11101010011010100000001" + "11101010111010101111111" + }, + /* 72*/ { UNICODE_MODE, 32, 2, -1, -1, "條碼", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 3 **NOT SAME** example uses 2-byte Region mode", + "11111110011001001111111" + "10000000001100000000001" + "10111110011111101111101" + "10100000001001000000101" + "10101110000010001110101" + "10101110011111001110101" + "10101110101001101110101" + "00000000100100100000000" + "00010101011111101000000" + "01001101101001001000010" + "10011010001001000001100" + "11010010111000110101111" + "01101011010110001001000" + "11000100100100110010100" + "00000010111111010101000" + "00000000101001100000000" + "11111110111011101110101" + "00000010011111001110101" + "11111010001001001110101" + "00001010011110000000101" + "11101010100111001111101" + "11101010001001000000001" + "11101010000100001111111" + }, + /* 73*/ { UNICODE_MODE, 32, 2, -1, 2 << 8, "པེ་ཅིང།", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 32 Example 4 same with explicit mask 01 (auto 10)", + "1111111011101011001111111" + "1000000001011100000000001" + "1011111011000010001111101" + "1010000001100101000000101" + "1010111000010001101110101" + "1010111010010111001110101" + "1010111000111110101110101" + "0000000011010101100000000" + "0001011000101001011000000" + "1100000111101101110000000" + "1011110000011001100100100" + "0001110001010101010100111" + "1001111001001100100011111" + "0011111011011001101101011" + "0101011010101010101111010" + "0101011000100010111101111" + "0000001101110001001101000" + "0000000011111011100000000" + "1111111010101100001110101" + "0000001000111010101110101" + "1111101011101010001110101" + "0000101001010101000000101" + "1110101000101101101111101" + "1110101001100100000000001" + "1110101001001010101111111" + }, + /* 74*/ { UNICODE_MODE, 32, 2, -1, -1, "バーコード", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 5 same", + "11111110111101101111111" + "10000000101100000000001" + "10111110000000101111101" + "10100000111000100000101" + "10101110110100001110101" + "10101110100111001110101" + "10101110111000101110101" + "00000000110001100000000" + "00010101000111010000000" + "00001011101000111000000" + "11101100001110000111010" + "11001011011101101010001" + "00000010100010001111101" + "01011101101100101000101" + "00000001011111010101000" + "00000000110010100000000" + "11111110101010101110101" + "00000010011100101110101" + "11111010010010101110101" + "00001010100100100000101" + "11101010110101001111101" + "11101010000101100000001" + "11101010111010101111111" + }, + /* 75*/ { UNICODE_MODE, 32, 2, -1, -1, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 6 same", + "11111110111101101111111" + "10000000101111000000001" + "10111110000000101111101" + "10100000111000100000101" + "10101110110110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100100100000000" + "00010101000111010000000" + "00011100101000111001111" + "00101010111101000110111" + "01101010111110011001101" + "01010000101011001000111" + "00101100110010111001111" + "00000001010100010101000" + "00000000111001100000000" + "11111110100110101110101" + "00000010001101101110101" + "11111010001101101110101" + "00001010110001100000101" + "11101010111010001111101" + "11101010011010100000001" + "11101010111010101111111" + }, + /* 76*/ { UNICODE_MODE, 33, 2, -1, 4 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 33 Example 1 same with explicit mask 11 (auto 10)", + "11111110111101101111111" + "10000000101111000000001" + "10111110000000101111101" + "10100000111001100000101" + "10101110111100001110101" + "10101110100111001110101" + "10101110111101101110101" + "00000000110101100000000" + "00010101000111010000000" + "00001111100000111001111" + "10001100010100111100110" + "10011000010001010001111" + "01000111011101111000111" + "00101101101101010011100" + "00000001010010010101000" + "00000000110001100000000" + "11111110100110101110101" + "00000010001101101110101" + "11111010001100101110101" + "00001010111000100000101" + "11101010110010001111101" + "11101010011010100000001" + "11101010111010101111111" + }, + /* 77*/ { UNICODE_MODE, 33, 2, -1, -1, "バーコード", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 33 Example 2 same", + "11111110111101101111111" + "10000000101101000000001" + "10111110000000101111101" + "10100000111001100000101" + "10101110111110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100111100000000" + "00010101000111010000000" + "00010000101000111001111" + "10001110100101000000101" + "11110010101101101100010" + "01010001001000011110100" + "10111010101110110111100" + "00000001001110010101000" + "00000000110111100000000" + "11111110111010101110101" + "00000010000101101110101" + "11111010000001101110101" + "00001010100010100000101" + "11101010101000001111101" + "11101010010011100000001" + "11101010111010101111111" + }, + /* 78*/ { UNICODE_MODE, 33, 2, -1, 2 << 8, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 33 Example 3 same with explicit mask 01 (auto 11)", + "11111110011010101111111" + "10000000011101100000001" + "10111110001010001111101" + "10100000110100100000101" + "10101110001100001110101" + "10101110110101101110101" + "10101110001010001110101" + "00000000110101000000000" + "00010101001010100000000" + "01010011010101010100000" + "11110010100101001000000" + "10110000011001101011111" + "01010010011011010011111" + "00101000000101001000100" + "00000000101010010101000" + "00000000010101100000000" + "11111110001101001110101" + "00000010110101101110101" + "11111010001010001110101" + "00001010111011100000101" + "11101010001010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 79*/ { UNICODE_MODE, 34, 2, -1, 4 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 34 Example 1 same with explicit mask 11 (auto 10)", + "11111110111101101111111" + "10000000101111000000001" + "10111110000000101111101" + "10100000111010100000101" + "10101110111110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100111100000000" + "00010101000111010000000" + "00010010011000111000111" + "10010000001111000100011" + "00101100011001110101100" + "01100101010010111000111" + "00101011101100111101010" + "00000001001010010101000" + "00000000110001100000000" + "11111110101101101110101" + "00000010011101101110101" + "11111010011101101110101" + "00001010101000100000101" + "11101010111010001111101" + "11101010011010100000001" + "11101010111010101111111" + }, + /* 80*/ { UNICODE_MODE, 34, 2, -1, 2 << 8, "バーコード", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 34 Example 2 same with explicit mask 01 (auto 10)", + "1111111011101011001111111" + "1000000001010101000000001" + "1011111010001110001111101" + "1010000001100111000000101" + "1010111000110110101110101" + "1010111011000010001110101" + "1010111000000000101110101" + "0000000011010101100000000" + "0001011001100110011000000" + "0010011010000101010101010" + "0010010010101010101010110" + "0011001101010110010110111" + "0110000010110001001010101" + "0010000101010101010101111" + "1000101010101010101110000" + "0111010101100101100100110" + "0000001101111010001101000" + "0000000010100001100000000" + "1111111011101011001110101" + "0000001000000110101110101" + "1111101011101010001110101" + "0000101001010101000000101" + "1110101000101010101111101" + "1110101001110101000000001" + "1110101000101010101111111" + }, + /* 81*/ { UNICODE_MODE, 34, 2, -1, 4 << 8, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 34 Example 3 same with explicit mask 11 (auto 01)", + "11111110111101101111111" + "10000000101111000000001" + "10111110000010101111101" + "10100000101010100000101" + "10101110111111001110101" + "10101110101110001110101" + "10101110101001101110101" + "00000000100111100000000" + "00010101011011010000000" + "00010110011000111000111" + "10010011010011000010011" + "11000010101111101110110" + "11000101110101111000111" + "00011111101110010110011" + "00000001011101010101000" + "00000000111010100000000" + "11111110110011101110101" + "00000010000111101110101" + "11111010001100101110101" + "00001010111111100000101" + "11101010100010001111101" + "11101010011010100000001" + "11101010111010101111111" + }, + /* 82*/ { UNICODE_MODE, 35, 2, -1, 2 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 35 Example 1 same with explicit mask 01 (auto 11)", + "11111110011010101111111" + "10000000011101100000001" + "10111110001010001111101" + "10100000110110100000101" + "10101110001110001110101" + "10101110110101101110101" + "10101110001110001110101" + "00000000100111000000000" + "00010101001010100000000" + "01000000101101010100010" + "10100000111110101010000" + "01110101101011000001100" + "01000111010101010100100" + "00111001010101010110000" + "00000000101101010101000" + "00000000001011100000000" + "11111110010001001110101" + "00000010100101101110101" + "11111010001010001110101" + "00001010110011100000101" + "11101010000010001111101" + "11101010110101000000001" + "11101010101010001111111" + }, + /* 83*/ { UNICODE_MODE, 35, 2, -1, -1, "バーコード", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 35 Example 2 same", + "1111111011101011001111111" + "1000000001110101000000001" + "1011111010100100001111101" + "1010000001000110000000101" + "1010111000110010101110101" + "1010111011010100001110101" + "1010111000011010101110101" + "0000000011010101100000000" + "0001011000101001011000000" + "1100100000000110001001011" + "0000011100101011001010101" + "0010100001010101010101000" + "0010001010101010101100001" + "0010010101101111000110001" + "0010010010110010101010111" + "0010010101010101010010101" + "0000001101001010001101000" + "0000000011010101100000000" + "1111111010101010001110101" + "0000001000101001101110101" + "1111101010100000001110101" + "0000101001010101000000101" + "1110101001100110101111101" + "1110101000101100000000001" + "1110101000001010101111111" + }, + /* 84*/ { UNICODE_MODE, 35, 2, -1, 4 << 8, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 35 Example 3 same with explicit mask 11 (auto 01)", + "11111110111101101111111" + "10000000101101000000001" + "10111110010000101111101" + "10100000111011100000101" + "10101110111110001110101" + "10101110100111001110101" + "10101110111001101110101" + "00000000100111100000000" + "00010101000111010000000" + "00010110011000111001101" + "11001101000100100111100" + "01110101101110001001100" + "01001101111100010001011" + "00111111010001000000011" + "00000001010010010101000" + "00000000110011100000000" + "11111110100111101110101" + "00000010011101101110101" + "11111010000000101110101" + "00001010111001100000101" + "11101010110101001111101" + "11101010011111100000001" + "11101010111010101111111" + }, + /* 85*/ { UNICODE_MODE, 170, 2, -1, -1, "sn:7QPB4MN", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 170 Example 1 same", + "11111110111100101111111" + "10000000100111000000001" + "10111110000000101111101" + "10100000111000100000101" + "10101110101100001110101" + "10101110100111001110101" + "10101110111100101110101" + "00000000100101100000000" + "00010101000111010000000" + "00000001000000111000110" + "01101000001101101011010" + "10011010011110101000101" + "10011110000111011110101" + "11100101111011010011101" + "00000001011010010101000" + "00000000100100100000000" + "11111110100101101110101" + "00000010010100101110101" + "11111010000011101110101" + "00001010101010100000101" + "11101010111101001111101" + "11101010000110100000001" + "11101010111010101111111" + }, + /* 86*/ { DATA_MODE, 899, 2, -1, -1, "\000\001\002\133\134\135\375\376\377", 9, 0, 23, 23, "AIM ITS/04-023:2022 ECI 899 Example 1 same", + "11111110011011101111111" + "10000000010110100000001" + "10111110010110001111101" + "10100000110110100000101" + "10101110011010001110101" + "10101110110101101110101" + "10101110001011001110101" + "00000000100110000000000" + "00010101001010100000000" + "01010101010101010101110" + "00100111001010101010010" + "11110101000100110000110" + "11100000101110011100001" + "11011110100100001000001" + "00000000110111010101000" + "00000000001011100000000" + "11111110010000001110101" + "00000010111011101110101" + "11111010010100001110101" + "00001010100100100000101" + "11101010000101001111101" + "11101010100010000000001" + "11101010101010001111111" + }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; struct zint_symbol *symbol; char escaped[8192]; + char cmp_buf[32768]; + char cmp_msg[1024]; + + int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise testStart("test_encode"); @@ -1477,16 +3184,19 @@ static void test_encode(int index, int generate, int debug) { symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - length = testUtilSetSymbol(symbol, BARCODE_HANXIN, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug); + length = testUtilSetSymbol(symbol, BARCODE_HANXIN, data[i].input_mode, data[i].eci, + data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, + data[i].data, data[i].length, debug); ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length); assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); if (generate) { - printf(" /*%3d*/ { %s, %d, %d, %s, \"%s\", %s, %d, %d, \"%s\",\n", - i, testUtilInputModeName(data[i].input_mode), data[i].option_1, data[i].option_2, testUtilOption3Name(data[i].option_3), - testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), testUtilErrorName(data[i].ret), - symbol->rows, symbol->width, data[i].comment); + printf(" /*%3d*/ { %s, %d, %d, %d, %s, \"%s\", %d, %s, %d, %d, \"%s\",\n", + i, testUtilInputModeName(data[i].input_mode), data[i].eci, + data[i].option_1, data[i].option_2, testUtilOption3Name(data[i].option_3), + testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), data[i].length, + testUtilErrorName(data[i].ret), symbol->rows, symbol->width, data[i].comment); testUtilModulesPrint(symbol, " ", "\n"); printf(" },\n"); } else { @@ -1497,6 +3207,18 @@ static void test_encode(int index, int generate, int debug) { ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { + int cmp_len, ret_len; + char modules_dump[49152]; + 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, cmp_buf, sizeof(cmp_buf), &cmp_len); + assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + 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); + } } } @@ -1623,3 +3345,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et norl : */ diff --git a/backend/tests/test_maxicode.c b/backend/tests/test_maxicode.c index ef277ebd..7915d9aa 100644 --- a/backend/tests/test_maxicode.c +++ b/backend/tests/test_maxicode.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -937,11 +936,11 @@ static void test_encode(int index, int generate, int debug) { i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[17984 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, data[i].primary, escaped, &ret_len); @@ -1186,3 +1185,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_medical.c b/backend/tests/test_medical.c index 36e56d72..c02d964f 100644 --- a/backend/tests/test_medical.c +++ b/backend/tests/test_medical.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2020 - 2021 Robin Stuart + Copyright (C) 2020-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -302,11 +301,11 @@ static void test_encode(int index, int generate, int debug) { assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[8192 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -337,3 +336,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_pdf417.c b/backend/tests/test_pdf417.c index c179f90d..91900f12 100644 --- a/backend/tests/test_pdf417.c +++ b/backend/tests/test_pdf417.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -1701,11 +1700,11 @@ static void test_encode(int index, int generate, int debug) { i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[2710 * 8 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -2172,3 +2171,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_qr.c b/backend/tests/test_qr.c index a53a43c6..1b3a57ef 100644 --- a/backend/tests/test_qr.c +++ b/backend/tests/test_qr.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et norl : */ #include "testcommon.h" @@ -164,7 +163,7 @@ static void test_qr_input(int index, int generate, int debug) { /* 3*/ { UNICODE_MODE, 26, -1, "é", 0, 26, "71 A4 02 C3 A9 00 EC 11 EC", "ECI-26 B2 (UTF-8)" }, /* 4*/ { DATA_MODE, 0, -1, "é", 0, 0, "40 2C 3A 90 EC 11 EC 11 EC", "B2 (UTF-8)" }, /* 5*/ { DATA_MODE, 0, -1, "\351", 0, 0, "40 1E 90 EC 11 EC 11 EC 11", "B1 (ISO 8859-1)" }, - /* 6*/ { UNICODE_MODE, 0, -1, "β", 0, 0, "80 11 00 00 EC 11 EC 11 EC", "K1 (Shift JIS)" }, + /* 6*/ { UNICODE_MODE, 0, -1, "β", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 11 00 00 EC 11 EC 11 EC", "K1 (Shift JIS)" }, /* 7*/ { UNICODE_MODE, 9, -1, "β", 0, 9, "70 94 01 E2 00 EC 11 EC 11", "ECI-9 B1 (ISO 8859-7)" }, /* 8*/ { UNICODE_MODE, 20, -1, "β", 0, 20, "71 48 01 10 00 00 EC 11 EC", "ECI-20 K1 (Shift JIS)" }, /* 9*/ { UNICODE_MODE, 26, -1, "β", 0, 26, "71 A4 02 CE B2 00 EC 11 EC", "ECI-26 B2 (UTF-8)" }, @@ -174,7 +173,7 @@ static void test_qr_input(int index, int generate, int debug) { /* 13*/ { UNICODE_MODE, 20, -1, "ก", ZINT_ERROR_INVALID_DATA, -1, "Error 800: Invalid character in input data", "ก not in Shift JIS" }, /* 14*/ { UNICODE_MODE, 26, -1, "ก", 0, 26, "71 A4 03 E0 B8 81 00 EC 11", "ECI-26 B3 (UTF-8)" }, /* 15*/ { DATA_MODE, 0, -1, "ก", 0, 0, "40 3E 0B 88 10 EC 11 EC 11", "B3 (UTF-8)" }, - /* 16*/ { UNICODE_MODE, 0, -1, "Ж", 0, 0, "80 11 23 80 EC 11 EC 11 EC", "K1 (Shift JIS)" }, + /* 16*/ { UNICODE_MODE, 0, -1, "Ж", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 11 23 80 EC 11 EC 11 EC", "K1 (Shift JIS)" }, /* 17*/ { UNICODE_MODE, 7, -1, "Ж", 0, 7, "70 74 01 B6 00 EC 11 EC 11", "ECI-7 B1 (ISO 8859-5)" }, /* 18*/ { UNICODE_MODE, 20, -1, "Ж", 0, 20, "71 48 01 12 38 00 EC 11 EC", "ECI-20 K1 (Shift JIS)" }, /* 19*/ { UNICODE_MODE, 26, -1, "Ж", 0, 26, "71 A4 02 D0 96 00 EC 11 EC", "ECI-26 B2 (UTF-8)" }, @@ -192,7 +191,7 @@ static void test_qr_input(int index, int generate, int debug) { /* 31*/ { UNICODE_MODE, 20, -1, "¥", 0, 20, "71 44 01 5C 00 EC 11 EC 11", "ECI-20 B1 (Shift JIS) (to single-byte backslash codepoint 5C, so byte mode)" }, /* 32*/ { UNICODE_MODE, 26, -1, "¥", 0, 26, "71 A4 02 C2 A5 00 EC 11 EC", "ECI-26 B2 (UTF-8)" }, /* 33*/ { DATA_MODE, 0, -1, "¥", 0, 0, "40 2C 2A 50 EC 11 EC 11 EC", "B2 (UTF-8)" }, - /* 34*/ { UNICODE_MODE, 0, -1, "・", 0, 0, "40 1A 50 EC 11 EC 11 EC 11", "B1 (Shift JIS) single-byte codepoint A5 (same bytes as ¥ ISO 8859-1 above, so ambiguous)" }, + /* 34*/ { UNICODE_MODE, 0, -1, "・", ZINT_WARN_NONCOMPLIANT, 0, "Warning 40 1A 50 EC 11 EC 11 EC 11", "B1 (Shift JIS) single-byte codepoint A5 (same bytes as ¥ ISO 8859-1 above, so ambiguous)" }, /* 35*/ { UNICODE_MODE, 3, -1, "・", ZINT_ERROR_INVALID_DATA, -1, "Error 575: Invalid character in input data for ECI 3", "" }, /* 36*/ { UNICODE_MODE, 20, -1, "・", 0, 20, "71 44 01 A5 00 EC 11 EC 11", "ECI-20 B1 (Shift JIS) single-byte codepoint A5" }, /* 37*/ { UNICODE_MODE, 26, -1, "・", 0, 26, "71 A4 03 EF BD A5 00 EC 11", "ECI-26 B3 (UTF-8)" }, @@ -202,7 +201,7 @@ static void test_qr_input(int index, int generate, int debug) { /* 41*/ { UNICODE_MODE, 20, -1, "¿", ZINT_ERROR_INVALID_DATA, -1, "Error 800: Invalid character in input data", "¿ not in Shift JIS" }, /* 42*/ { UNICODE_MODE, 26, -1, "¿", 0, 26, "71 A4 02 C2 BF 00 EC 11 EC", "ECI-26 B2 (UTF-8)" }, /* 43*/ { DATA_MODE, 0, -1, "¿", 0, 0, "40 2C 2B F0 EC 11 EC 11 EC", "B2 (UTF-8)" }, - /* 44*/ { UNICODE_MODE, 0, -1, "ソ", 0, 0, "40 1B F0 EC 11 EC 11 EC 11", "B1 (Shift JIS) single-byte codepoint BF (same bytes as ¿ ISO 8859-1 above, so ambiguous)" }, + /* 44*/ { UNICODE_MODE, 0, -1, "ソ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 40 1B F0 EC 11 EC 11 EC 11", "B1 (Shift JIS) single-byte codepoint BF (same bytes as ¿ ISO 8859-1 above, so ambiguous)" }, /* 45*/ { UNICODE_MODE, 3, -1, "ソ", ZINT_ERROR_INVALID_DATA, -1, "Error 575: Invalid character in input data for ECI 3", "" }, /* 46*/ { UNICODE_MODE, 20, -1, "ソ", 0, 20, "71 44 01 BF 00 EC 11 EC 11", "ECI-20 B1 (Shift JIS) single-byte codepoint BF" }, /* 47*/ { UNICODE_MODE, 26, -1, "ソ", 0, 26, "71 A4 03 EF BD BF 00 EC 11", "ECI-26 B3 (UTF-8)" }, @@ -210,30 +209,30 @@ static void test_qr_input(int index, int generate, int debug) { /* 49*/ { UNICODE_MODE, 0, -1, "~", 0, 0, "40 17 E0 EC 11 EC 11 EC 11", "B1 (ASCII) (same bytes as ‾ Shift JIS below, so ambiguous)" }, /* 50*/ { UNICODE_MODE, 3, -1, "~", 0, 3, "70 34 01 7E 00 EC 11 EC 11", "ECI-3 B1 (ASCII)" }, /* 51*/ { UNICODE_MODE, 20, -1, "~", ZINT_ERROR_INVALID_DATA, -1, "Error 800: Invalid character in input data", "tilde not in Shift JIS (codepoint used for overline)" }, - /* 52*/ { UNICODE_MODE, 0, -1, "‾", 0, 0, "40 17 E0 EC 11 EC 11 EC 11", "B1 (Shift JIS) single-byte codepoint 7E (same bytes as ~ ASCII above, so ambiguous)" }, + /* 52*/ { UNICODE_MODE, 0, -1, "‾", ZINT_WARN_NONCOMPLIANT, 0, "Warning 40 17 E0 EC 11 EC 11 EC 11", "B1 (Shift JIS) single-byte codepoint 7E (same bytes as ~ ASCII above, so ambiguous)" }, /* 53*/ { UNICODE_MODE, 3, -1, "‾", ZINT_ERROR_INVALID_DATA, -1, "Error 575: Invalid character in input data for ECI 3", "" }, /* 54*/ { UNICODE_MODE, 20, -1, "‾", 0, 20, "71 44 01 7E 00 EC 11 EC 11", "ECI-20 B1 (Shift JIS) (to single-byte tilde codepoint 7E, so byte mode)" }, /* 55*/ { UNICODE_MODE, 26, -1, "‾", 0, 26, "71 A4 03 E2 80 BE 00 EC 11", "ECI-26 B3 (UTF-8)" }, /* 56*/ { DATA_MODE, 0, -1, "‾", 0, 0, "40 3E 28 0B E0 EC 11 EC 11", "B3 (UTF-8)" }, - /* 57*/ { UNICODE_MODE, 0, -1, "点", 0, 0, "80 16 CF 80 EC 11 EC 11 EC", "K1 (Shift JIS)" }, + /* 57*/ { UNICODE_MODE, 0, -1, "点", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 16 CF 80 EC 11 EC 11 EC", "K1 (Shift JIS)" }, /* 58*/ { UNICODE_MODE, 3, -1, "点", ZINT_ERROR_INVALID_DATA, -1, "Error 575: Invalid character in input data for ECI 3", "" }, /* 59*/ { UNICODE_MODE, 20, -1, "点", 0, 20, "71 48 01 6C F8 00 EC 11 EC", "ECI-20 K1 (Shift JIS)" }, /* 60*/ { UNICODE_MODE, 26, -1, "点", 0, 26, "71 A4 03 E7 82 B9 00 EC 11", "ECI-26 B3 (UTF-8)" }, /* 61*/ { DATA_MODE, 0, -1, "点", 0, 0, "40 3E 78 2B 90 EC 11 EC 11", "B3 (UTF-8)" }, /* 62*/ { DATA_MODE, 0, -1, "\223\137", 0, 0, "40 29 35 F0 EC 11 EC 11 EC", "B2 (Shift JIS) (not full multibyte)" }, /* 63*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "\223\137", 0, 0, "80 16 CF 80 EC 11 EC 11 EC", "K1 (Shift JIS)" }, - /* 64*/ { UNICODE_MODE, 0, -1, "¥・点", 0, 0, "40 45 CA 59 35 F0 EC 11 EC", "B4 (Shift JIS) (optimized to byte mode only)" }, + /* 64*/ { UNICODE_MODE, 0, -1, "¥・点", ZINT_WARN_NONCOMPLIANT, 0, "Warning 40 45 CA 59 35 F0 EC 11 EC", "B4 (Shift JIS) (optimized to byte mode only)" }, /* 65*/ { UNICODE_MODE, 3, -1, "¥・点", ZINT_ERROR_INVALID_DATA, -1, "Error 575: Invalid character in input data for ECI 3", "" }, /* 66*/ { UNICODE_MODE, 20, -1, "¥・点", 0, 20, "71 44 04 5C A5 93 5F 00 EC", "ECI-20 B4 (Shift JIS)" }, /* 67*/ { UNICODE_MODE, 26, -1, "¥・点", 0, 26, "71 A4 08 C2 A5 EF BD A5 E7 82 B9 00 EC", "ECI-26 B8 (UTF-8)" }, /* 68*/ { DATA_MODE, 0, -1, "\134\245\223\137", 0, 0, "40 45 CA 59 35 F0 EC 11 EC", "B8 (Shift JIS)" }, /* 69*/ { DATA_MODE, 0, -1, "¥・点", 0, 0, "40 8C 2A 5E FB DA 5E 78 2B 90 EC 11 EC", "B8 (UTF-8)" }, - /* 70*/ { UNICODE_MODE, 0, -1, "点茗", 0, 0, "80 26 CF EA A8 00 EC 11 EC", "K2 (Shift JIS)" }, - /* 71*/ { UNICODE_MODE, 0, -1, "点茗テ", 0, 0, "80 36 CF EA A8 34 A0 EC 11", "K3 (Shift JIS)" }, - /* 72*/ { UNICODE_MODE, 0, -1, "点茗テ点", 0, 0, "80 46 CF EA A8 34 AD 9F 00", "K4 (Shift JIS)" }, - /* 73*/ { UNICODE_MODE, 0, -1, "点茗テ点茗", 0, 0, "80 56 CF EA A8 34 AD 9F D5 50 00 EC 11", "K5 (Shift JIS)" }, - /* 74*/ { UNICODE_MODE, 0, -1, "点茗テ点茗テ", 0, 0, "80 66 CF EA A8 34 AD 9F D5 50 69 40 EC", "K6 (Shift JIS)" }, - /* 75*/ { UNICODE_MODE, 0, -1, "点茗テ点茗テソ", 0, 0, "80 66 CF EA A8 34 AD 9F D5 50 69 50 06 FC 00 EC", "K6 B1 (Shift JIS)" }, + /* 70*/ { UNICODE_MODE, 0, -1, "点茗", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 26 CF EA A8 00 EC 11 EC", "K2 (Shift JIS)" }, + /* 71*/ { UNICODE_MODE, 0, -1, "点茗テ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 36 CF EA A8 34 A0 EC 11", "K3 (Shift JIS)" }, + /* 72*/ { UNICODE_MODE, 0, -1, "点茗テ点", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 46 CF EA A8 34 AD 9F 00", "K4 (Shift JIS)" }, + /* 73*/ { UNICODE_MODE, 0, -1, "点茗テ点茗", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 56 CF EA A8 34 AD 9F D5 50 00 EC 11", "K5 (Shift JIS)" }, + /* 74*/ { UNICODE_MODE, 0, -1, "点茗テ点茗テ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 66 CF EA A8 34 AD 9F D5 50 69 40 EC", "K6 (Shift JIS)" }, + /* 75*/ { UNICODE_MODE, 0, -1, "点茗テ点茗テソ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 66 CF EA A8 34 AD 9F D5 50 69 50 06 FC 00 EC", "K6 B1 (Shift JIS)" }, /* 76*/ { DATA_MODE, 0, -1, "\223\137\344\252\203\145\223\137\344\252\203\145\277", 0, 0, "40 D9 35 FE 4A A8 36 59 35 FE 4A A8 36 5B F0 EC", "B13 (Shift JIS)" }, /* 77*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "\223\137\344\252\203\145\223\137\344\252\203\145\277", 0, 0, "80 66 CF EA A8 34 AD 9F D5 50 69 50 06 FC 00 EC", "K6 B1 (Shift JIS) (full multibyte)" }, /* 78*/ { DATA_MODE, 0, -1, "点茗テ点茗テソ", 0, 0, "41 5E 78 2B 9E 88 C9 7E 38 38 6E 78 2B 9E 88 C9 7E 38 38 6E FB DB F0 EC 11 EC 11 EC", "B21 (UTF-8)" }, @@ -256,11 +255,11 @@ static void test_qr_input(int index, int generate, int debug) { /* 95*/ { UNICODE_MODE, 6, -1, "ĸ", 0, 6, "70 64 01 A2 00 EC 11 EC 11", "ECI-6 B1 (ISO 8859-4)" }, /* 96*/ { UNICODE_MODE, 0, -1, "Ș", ZINT_WARN_USES_ECI, 18, "Warning 71 24 01 AA 00 EC 11 EC 11", "ECI-18 B1 (ISO 8859-16)" }, /* 97*/ { UNICODE_MODE, 18, -1, "Ș", 0, 18, "71 24 01 AA 00 EC 11 EC 11", "ECI-18 B1 (ISO 8859-16)" }, - /* 98*/ { UNICODE_MODE, 0, -1, "テ", 0, 0, "80 10 D2 80 EC 11 EC 11 EC", "K1 (SHIFT JIS)" }, + /* 98*/ { UNICODE_MODE, 0, -1, "テ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 10 D2 80 EC 11 EC 11 EC", "K1 (SHIFT JIS)" }, /* 99*/ { UNICODE_MODE, 20, -1, "テ", 0, 20, "71 48 01 0D 28 00 EC 11 EC", "ECI-20 K1 (SHIFT JIS)" }, /*100*/ { UNICODE_MODE, 20, -1, "テテ", 0, 20, "71 48 02 0D 28 69 40 EC 11", "ECI-20 K2 (SHIFT JIS)" }, /*101*/ { UNICODE_MODE, 20, -1, "\\\\", 0, 20, "71 48 02 00 F8 07 C0 EC 11", "ECI-20 K2 (SHIFT JIS)" }, - /*102*/ { UNICODE_MODE, 0, -1, "…", 0, 0, "80 10 11 80 EC 11 EC 11 EC", "K1 (SHIFT JIS)" }, + /*102*/ { UNICODE_MODE, 0, -1, "…", ZINT_WARN_NONCOMPLIANT, 0, "Warning 80 10 11 80 EC 11 EC 11 EC", "K1 (SHIFT JIS)" }, /*103*/ { UNICODE_MODE, 21, -1, "…", 0, 21, "71 54 01 85 00 EC 11 EC 11", "ECI-21 B1 (Win 1250)" }, /*104*/ { UNICODE_MODE, 0, -1, "Ґ", ZINT_WARN_USES_ECI, 22, "Warning 71 64 01 A5 00 EC 11 EC 11", "ECI-22 B1 (Win 1251)" }, /*105*/ { UNICODE_MODE, 22, -1, "Ґ", 0, 22, "71 64 01 A5 00 EC 11 EC 11", "ECI-22 B1 (Win 1251)" }, @@ -403,7 +402,7 @@ static void test_qr_optimize(int index, int generate, int debug) { /* 2*/ { UNICODE_MODE, -1, "0123456789", 0, "10 28 0C 56 6A 69 00 EC 11", " N10 (nayuki.io - pure numeric)" }, /* 3*/ { UNICODE_MODE, -1, "ABCDEF", 0, "20 31 CD 45 2A 14 00 EC 11", "A6 (nayuki.io - pure alphanumeric)" }, /* 4*/ { UNICODE_MODE, -1, "wxyz", 0, "40 47 77 87 97 A0 EC 11 EC", "B4 (nayuki.io - pure byte)" }, - /* 5*/ { UNICODE_MODE, 1, "「魔法少女まどか☆マギカ」って、 ИАИ desu κα?", 0, "(55) 81 D0 1A C0 09 F8 0A ED 56 B8 57 02 8E 12 90 2C 86 F4 31 A1 8A 01 B0 50 42 88 00 10", "K29 (nayuki.io - pure kanji)" }, + /* 5*/ { UNICODE_MODE, 1, "「魔法少女まどか☆マギカ」って、 ИАИ desu κα?", ZINT_WARN_NONCOMPLIANT, "Warning (55) 81 D0 1A C0 09 F8 0A ED 56 B8 57 02 8E 12 90 2C 86 F4 31 A1 8A 01 B0 50 42 88 00 10", "K29 (nayuki.io - pure kanji)" }, /* 6*/ { UNICODE_MODE, -1, "012345A", 0, "20 38 01 0B A2 E4 A0 EC 11", "A7 (nayuki.io - alpha/numeric)" }, /* 7*/ { UNICODE_MODE, -1, "0123456A", 0, "10 1C 0C 56 58 80 25 00 EC", "N7 A1 (nayuki.io - alpha/numeric) (note same bits as A8)" }, /* 8*/ { UNICODE_MODE, -1, "012a", 0, "40 43 03 13 26 10 EC 11 EC", "B4 (nayuki.io - numeric/byte)" }, @@ -411,23 +410,23 @@ static void test_qr_optimize(int index, int generate, int debug) { /* 10*/ { UNICODE_MODE, -1, "ABCDEa", 0, "40 64 14 24 34 44 56 10 EC", "B6 (nayuki.io - alphanumeric/byte)" }, /* 11*/ { UNICODE_MODE, -1, "ABCDEFa", 0, "20 31 CD 45 2A 15 00 58 40", "A6 B1 (nayuki.io - alphanumeric/byte)" }, /* 12*/ { UNICODE_MODE, 1, "THE SQUARE ROOT OF 2 IS 1.41421356237309504880168872420969807856967187537694807317667973799", 0, "(55) 20 D5 2A 53 54 1A A8 4C DC DF 14 29 EC 47 CA D9 9A 88 05 71 10 59 E3 56 32 5D 45 F0", " A26 N65 (nayuki.io - alpha/numeric)" }, - /* 13*/ { UNICODE_MODE, 1, "Golden ratio φ = 1.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374......", 0, "(80) 41 44 76 F6 C6 46 56 E2 07 26 17 46 96 F2 08 3D 32 03 D2 03 12 E1 19 26 A0 87 DC BB", "B20 N100 A6 (nayuki.io - alpha/numeric/byte)" }, - /* 14*/ { UNICODE_MODE, 1, "こんにちwa、世界! αβγδ", 0, "(34) 41 B8 2B 18 2F 18 2C 98 2B F7 76 18 14 19 0A 28 A4 58 14 92 08 3B F8 3C 08 3C 18 3C", "B27 (nayuki.io - kanji/european **NOT SAME** K4 B2 K4 A1 K4, less bits as nayuki (1.5.0) miscounting byte-mode input as UTF-8)" }, - /* 15*/ { UNICODE_MODE, 1, "こんにちテwa、世界! αβγδ", 0, "(34) 80 50 98 85 C4 29 21 3F 0D 2A 09 BB B0 C0 A0 C8 51 45 22 C0 A4 90 41 DF C1 E0 41 E0", "K5 B19 (nayuki.io - kanji/european + extra leading kanji **NOT SAME** K5 B2 K4 A1 K4, same reason as above)" }, + /* 13*/ { UNICODE_MODE, 1, "Golden ratio φ = 1.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374......", ZINT_WARN_NONCOMPLIANT, "Warning (80) 41 44 76 F6 C6 46 56 E2 07 26 17 46 96 F2 08 3D 32 03 D2 03 12 E1 19 26 A0 87 DC BB", "B20 N100 A6 (nayuki.io - alpha/numeric/byte)" }, + /* 14*/ { UNICODE_MODE, 1, "こんにちwa、世界! αβγδ", ZINT_WARN_NONCOMPLIANT, "Warning (34) 41 B8 2B 18 2F 18 2C 98 2B F7 76 18 14 19 0A 28 A4 58 14 92 08 3B F8 3C 08 3C 18 3C", "B27 (nayuki.io - kanji/european **NOT SAME** K4 B2 K4 A1 K4, less bits as nayuki (1.5.0) miscounting byte-mode input as UTF-8)" }, + /* 15*/ { UNICODE_MODE, 1, "こんにちテwa、世界! αβγδ", ZINT_WARN_NONCOMPLIANT, "Warning (34) 80 50 98 85 C4 29 21 3F 0D 2A 09 BB B0 C0 A0 C8 51 45 22 C0 A4 90 41 DF C1 E0 41 E0", "K5 B19 (nayuki.io - kanji/european + extra leading kanji **NOT SAME** K5 B2 K4 A1 K4, same reason as above)" }, /* 16*/ { UNICODE_MODE, 1, "67128177921547861663com.acme35584af52fa3-88d0-093b-6c14-b37ddafb59c528908608sg.com.dash.www0530329356521790265903SG.COM.NETS46968696003522G33250183309051017567088693441243693268766948304B2AE13344004SG.SGQR209710339366720B439682.63667470805057501195235502733744600368027857918629797829126902859SG8236HELLO FOO2517Singapore3272B815", 0, "(232) 10 52 9F 46 70 B3 5D DE 9A 1F A1 7B 1B 7B 69 73 0B 1B 6B 29 99 A9 A9 C1 A3 0B 31 A9", "N20 B47 N9 B15 N22 A11 N14 A1 N47 A19 N15 A8 N65 A20 B8 A8 (nayuki.io - SGQR alpha/numeric/byte)" }, /* 17*/ { UNICODE_MODE, -1, "纪", ZINT_WARN_USES_ECI, "Warning 71 A4 03 E7 BA AA 00 EC 11", "ECI-26 B3 (UTF-8 E7BAAA, U+7EAA, not in Shift JIS)" }, /* 18*/ { DATA_MODE, -1, "纪", 0, "40 3E 7B AA A0 EC 11 EC 11", "B3 (UTF-8 or Shift JIS, note ambiguous as 0xE7BA 0xAA happens to be valid Shift JIS 郤ェ as well)" }, - /* 19*/ { UNICODE_MODE, -1, "郤ェ", 0, "40 3E 7B AA A0 EC 11 EC 11", "B3 (Shift JIS or UTF-8 E7BAAA 纪, see above)" }, + /* 19*/ { UNICODE_MODE, -1, "郤ェ", ZINT_WARN_NONCOMPLIANT, "Warning 40 3E 7B AA A0 EC 11 EC 11", "B3 (Shift JIS or UTF-8 E7BAAA 纪, see above)" }, /* 20*/ { UNICODE_MODE, 1, "2004年大西洋颶風季是有纪录以来造成人员伤亡和财产损失最为惨重的大西洋飓风季之一,于2004年6月1日正式开始,同年11月30日结束,传统上这样的日期界定了一年中绝大多数热带气旋在大西洋形成的时间段lll ku", ZINT_WARN_USES_ECI, "Warning (324) 71 A1 00 43 21 10 04 4B 96 E6 D3 96 92 9F A2 96 FF 9A D2 2F A6 8A DB A6 8A A3 96 B6", "ECI-26 N4 B274 (nayuki.io - kanji/byte/numeric **NOT SAME* N4 K9 B6 K5 etc mixing Shift JIS and UTF-8)" }, /* 21*/ { UNICODE_MODE, -1, "AB123456A", 0, "20 49 CD 05 E2 2C 73 94 00", "A9" }, /* 22*/ { UNICODE_MODE, -1, "AB1234567890A", 0, "20 69 CD 05 E2 2C 73 94 33 2A 50 00 EC", "A13" }, /* 23*/ { UNICODE_MODE, -1, "AB123456789012A", 0, "20 79 CD 05 E2 2C 73 94 33 2A 0B CA 00", "A15" }, /* 24*/ { UNICODE_MODE, -1, "AB1234567890123A", 0, "20 11 CD 10 34 7B 72 31 50 30 C8 02 50", "A2 N13 A1" }, - /* 25*/ { UNICODE_MODE, -1, "テaABCD1", 0, "40 88 36 56 14 14 24 34 43 10 EC 11 EC", "B8" }, - /* 26*/ { UNICODE_MODE, -1, "テaABCDE1", 0, "40 38 36 56 12 03 1C D4 52 9D C0 EC 11", "B3 A6" }, + /* 25*/ { UNICODE_MODE, -1, "テaABCD1", ZINT_WARN_NONCOMPLIANT, "Warning 40 88 36 56 14 14 24 34 43 10 EC 11 EC", "B8" }, + /* 26*/ { UNICODE_MODE, -1, "テaABCDE1", ZINT_WARN_NONCOMPLIANT, "Warning 40 38 36 56 12 03 1C D4 52 9D C0 EC 11", "B3 A6" }, /* 27*/ { UNICODE_MODE, -1, "テéaABCDE1", ZINT_WARN_USES_ECI, "Warning 71 A4 06 E3 83 86 C3 A9 61 20 31 CD 45 29 DC 00", "B6 A6" }, - /* 28*/ { UNICODE_MODE, -1, "貫やぐ識禁ぱい再2間変字全ノレ没無8裁", 0, "(44) 80 83 A8 85 88 25 CA 2F 40 B0 53 C2 44 98 41 00 4A 02 0E A8 F8 F5 0D 30 4C 35 A1 CC", "K8 N1 K8 B3" }, - /* 29*/ { UNICODE_MODE, -1, "貫やぐ識禁ぱい再2間変字全ノレ没無8裁花ほゃ過法ひなご札17能つーびれ投覧マ勝動エヨ額界よみ作皇ナヲニ打題ヌルヲ掲布益フが。入35能ト権話しこを断兆モヘ細情おじ名4減エヘイハ側機はょが意見想ハ業独案ユヲウ患職ヲ平美さ毎放どぽたけ家没べお化富べ町大シ情魚ッでれ一冬すぼめり。社ト可化モマ試音ばじご育青康演ぴぎ権型固スで能麩ぜらもほ河都しちほラ収90作の年要とだむ部動ま者断チ第41一1米索焦茂げむしれ。測フ物使だて目月国スリカハ夏検にいへ児72告物ゆは載核ロアメヱ登輸どべゃ催行アフエハ議歌ワ河倫剖だ。記タケウ因載ヒイホヤ禁3輩彦関トえび肝区勝ワリロ成禁ぼよ界白ウヒキレ中島べせぜい各安うしぽリ覧生テ基一でむしゃ中新トヒキソ声碁スしび起田ア信大未ゅもばち。", 0, "(589) 80 20 EA 21 62 09 72 8B D0 2C 14 F0 91 26 10 40 04 A0 08 3A A3 E3 D4 34 C1 30 D6 87", "K8 N1 K8 N1 K10 N2 K33 N2 K16 N1 K89 N2 K14 B5 K28 N2 K40 N1 K65" }, + /* 28*/ { UNICODE_MODE, -1, "貫やぐ識禁ぱい再2間変字全ノレ没無8裁", ZINT_WARN_NONCOMPLIANT, "Warning (44) 80 83 A8 85 88 25 CA 2F 40 B0 53 C2 44 98 41 00 4A 02 0E A8 F8 F5 0D 30 4C 35 A1 CC", "K8 N1 K8 B3" }, + /* 29*/ { UNICODE_MODE, -1, "貫やぐ識禁ぱい再2間変字全ノレ没無8裁花ほゃ過法ひなご札17能つーびれ投覧マ勝動エヨ額界よみ作皇ナヲニ打題ヌルヲ掲布益フが。入35能ト権話しこを断兆モヘ細情おじ名4減エヘイハ側機はょが意見想ハ業独案ユヲウ患職ヲ平美さ毎放どぽたけ家没べお化富べ町大シ情魚ッでれ一冬すぼめり。社ト可化モマ試音ばじご育青康演ぴぎ権型固スで能麩ぜらもほ河都しちほラ収90作の年要とだむ部動ま者断チ第41一1米索焦茂げむしれ。測フ物使だて目月国スリカハ夏検にいへ児72告物ゆは載核ロアメヱ登輸どべゃ催行アフエハ議歌ワ河倫剖だ。記タケウ因載ヒイホヤ禁3輩彦関トえび肝区勝ワリロ成禁ぼよ界白ウヒキレ中島べせぜい各安うしぽリ覧生テ基一でむしゃ中新トヒキソ声碁スしび起田ア信大未ゅもばち。", ZINT_WARN_NONCOMPLIANT, "Warning (589) 80 20 EA 21 62 09 72 8B D0 2C 14 F0 91 26 10 40 04 A0 08 3A A3 E3 D4 34 C1 30 D6 87", "K8 N1 K8 N1 K10 N2 K33 N2 K16 N1 K89 N2 K14 B5 K28 N2 K40 N1 K65" }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -471,11 +470,13 @@ static void test_qr_encode(int index, int generate, int debug) { struct item { int symbology; int input_mode; + int eci; int option_1; int option_2; int option_3; struct zint_structapp structapp; char *data; + int length; int ret; int expected_rows; @@ -486,7 +487,7 @@ static void test_qr_encode(int index, int generate, int debug) { }; // や U+3084 kanji, in Shift JIS 0x82E2 (\202\342), UTF-8 E38284; its 2nd byte 0xE2 + 0x40-FC also form Shift JIS struct item data[] = { - /* 0*/ { BARCODE_QRCODE, UNICODE_MODE, -1, -1, -1, { 0, 0, "" }, "QR Code Symbol", 0, 21, 21, 0, "ISO 18004 Figure 1 **NOT SAME** uses mask 110 instead of 101; BWIPP uses 101", + /* 0*/ { BARCODE_QRCODE, UNICODE_MODE, -1, -1, -1, -1, { 0, 0, "" }, "QR Code Symbol", -1, 0, 21, 21, 0, "ISO 18004 Figure 1 **NOT SAME** uses mask 110 instead of 101; BWIPP uses 101", "111111101001101111111" "100000101001101000001" "101110101100101011101" @@ -509,7 +510,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100001101111111" "111111101001011000000" }, - /* 1*/ { BARCODE_QRCODE, UNICODE_MODE, -1, -1, 6 << 8, { 0, 0, "" }, "QR Code Symbol", 0, 21, 21, 1, "ISO 18004 Figure 1, explicit mask 101, same", + /* 1*/ { BARCODE_QRCODE, UNICODE_MODE, -1, -1, -1, 6 << 8, { 0, 0, "" }, "QR Code Symbol", -1, 0, 21, 21, 1, "ISO 18004 Figure 1, explicit mask 101, same", "111111100001101111111" "100000101001101000001" "101110101110101011101" @@ -532,7 +533,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100001110111100" "111111101011001010010" }, - /* 2*/ { BARCODE_QRCODE, UNICODE_MODE, 2, -1, -1, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, 33, 33, 1, "ISO 18004 Figure 29 (top), same (mask 100)", + /* 2*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, -1, -1, { 0, 0, "" }, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 33, 33, 1, "ISO 18004 Figure 29 (top), same (mask 100)", "111111101100110010010010101111111" "100000100010111010111000101000001" "101110100000001101101100001011101" @@ -567,7 +568,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100010110111000110101001001" "111111101101101011010000111100011" }, - /* 3*/ { BARCODE_QRCODE, UNICODE_MODE, 2, -1, -1, { 1, 4, "1" }, "ABCDEFGHIJKLMN", 0, 21, 21, 1, "ISO 18004 Figure 29 (bottom 1st), same", + /* 3*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, -1, -1, { 1, 4, "1" }, "ABCDEFGHIJKLMN", -1, 0, 21, 21, 1, "ISO 18004 Figure 29 (bottom 1st), same", "111111100110001111111" "100000101001101000001" "101110100010001011101" @@ -590,7 +591,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100101110000001" "111111101000110110101" }, - /* 4*/ { BARCODE_QRCODE, UNICODE_MODE, 2, -1, 8 << 8, { 2, 4, "1" }, "OPQRSTUVWXYZ0123", 0, 21, 21, 1, "ISO 18004 Figure 29 (bottom 2nd), same with explicit mask 111 (auto 011)", + /* 4*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, -1, 8 << 8, { 2, 4, "1" }, "OPQRSTUVWXYZ0123", -1, 0, 21, 21, 1, "ISO 18004 Figure 29 (bottom 2nd), same with explicit mask 111 (auto 011)", "111111100011101111111" "100000100001101000001" "101110100001101011101" @@ -613,7 +614,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100111100011111" "111111101011011110100" }, - /* 5*/ { BARCODE_QRCODE, UNICODE_MODE, 2, -1, -1, { 3, 4, "1" }, "456789ABCDEFGHIJ", 0, 21, 21, 1, "ISO 18004 Figure 29 (bottom 3rd), same", + /* 5*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, -1, -1, { 3, 4, "1" }, "456789ABCDEFGHIJ", -1, 0, 21, 21, 1, "ISO 18004 Figure 29 (bottom 3rd), same", "111111100101001111111" "100000100011101000001" "101110100010101011101" @@ -636,7 +637,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100011100101011" "111111101011000011000" }, - /* 6*/ { BARCODE_QRCODE, UNICODE_MODE, 2, -1, -1, { 4, 4, "1" }, "KLMNOPQRSTUVWXYZ", 0, 21, 21, 1, "ISO 18004 Figure 29 (bottom 4th), same", + /* 6*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, -1, -1, { 4, 4, "1" }, "KLMNOPQRSTUVWXYZ", -1, 0, 21, 21, 1, "ISO 18004 Figure 29 (bottom 4th), same", "111111101011101111111" "100000101010101000001" "101110100011001011101" @@ -659,7 +660,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100010110010010" "111111101110110101110" }, - /* 7*/ { BARCODE_QRCODE, UNICODE_MODE, 2, 1, -1, { 0, 0, "" }, "01234567", 0, 21, 21, 0, "ISO 18004 Annex I I.2, same (mask 010); BWIPP uses mask 000", + /* 7*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, 1, -1, { 0, 0, "" }, "01234567", -1, 0, 21, 21, 0, "ISO 18004 Annex I I.2, same (mask 010); BWIPP uses mask 000", "111111100101101111111" "100000100111101000001" "101110101000001011101" @@ -682,7 +683,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100000000110110" "111111101111010010100" }, - /* 8*/ { BARCODE_QRCODE, UNICODE_MODE, 2, 1, 1 << 8, { 0, 0, "" }, "01234567", 0, 21, 21, 1, "ISO 18004 Annex I Figure I.2, explicit mask 000, same as BWIPP", + /* 8*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, 1, 1 << 8, { 0, 0, "" }, "01234567", -1, 0, 21, 21, 1, "ISO 18004 Annex I Figure I.2, explicit mask 000, same as BWIPP", "111111100011101111111" "100000101110001000001" "101110100110001011101" @@ -705,7 +706,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100001110111000" "111111101001011100101" }, - /* 9*/ { BARCODE_QRCODE, GS1_MODE, 1, -1, -1, { 0, 0, "" }, "[01]09501101530003[8200]http://example.com", 0, 25, 25, 0, "GS1 General Specifications 21.0.1 Figure 5.1-7 **NOT SAME** figure uses Byte encodation only; BWIPP uses mask 001", + /* 9*/ { BARCODE_QRCODE, GS1_MODE, -1, 1, -1, -1, { 0, 0, "" }, "[01]09501101530003[8200]http://example.com", -1, 0, 25, 25, 0, "GS1 General Specifications 21.0.1 Figure 5.1-7 **NOT SAME** figure uses Byte encodation only; BWIPP uses mask 001", "1111111001101101001111111" "1000001010010101001000001" "1011101011111010101011101" @@ -732,7 +733,7 @@ static void test_qr_encode(int index, int generate, int debug) { "1000001010110101100111010" "1111111011101100010010111" }, - /* 10*/ { BARCODE_QRCODE, GS1_MODE, 1, -1, 2 << 8, { 0, 0, "" }, "[01]09501101530003[8200]http://example.com", 0, 25, 25, 1, "GS1 General Specifications 21.0.1 Figure 5.1-7, explicit mask 001, same as BWIPP", + /* 10*/ { BARCODE_QRCODE, GS1_MODE, -1, 1, -1, 2 << 8, { 0, 0, "" }, "[01]09501101530003[8200]http://example.com", -1, 0, 25, 25, 1, "GS1 General Specifications 21.0.1 Figure 5.1-7, explicit mask 001, same as BWIPP", "1111111010111000001111111" "1000001011100100101000001" "1011101000111101101011101" @@ -759,7 +760,7 @@ static void test_qr_encode(int index, int generate, int debug) { "1000001011110010100000010" "1111111010111001000111101" }, - /* 11*/ { BARCODE_QRCODE, GS1_MODE, 2, -1, -1, { 0, 0, "" }, "[01]00857674002010[8200]http://www.gs1.org/", 0, 29, 29, 0, "GS1 General Specifications 21.0.1 Figure 5.7.3-1, same (mask 011); BWIPP uses mask 101", + /* 11*/ { BARCODE_QRCODE, GS1_MODE, -1, 2, -1, -1, { 0, 0, "" }, "[01]00857674002010[8200]http://www.gs1.org/", -1, 0, 29, 29, 0, "GS1 General Specifications 21.0.1 Figure 5.7.3-1, same (mask 011); BWIPP uses mask 101", "11111110100101110101001111111" "10000010111101001000001000001" "10111010010000001110001011101" @@ -790,7 +791,7 @@ static void test_qr_encode(int index, int generate, int debug) { "10000010010111010001110010100" "11111110101111111011110100110" }, - /* 12*/ { BARCODE_QRCODE, GS1_MODE, 2, -1, 6 << 8, { 0, 0, "" }, "[01]00857674002010[8200]http://www.gs1.org/", 0, 29, 29, 1, "GS1 General Specifications 21.0.1 Figure 5.7.3-1, explicit mask 101, same as BWIPP", + /* 12*/ { BARCODE_QRCODE, GS1_MODE, -1, 2, -1, 6 << 8, { 0, 0, "" }, "[01]00857674002010[8200]http://www.gs1.org/", -1, 0, 29, 29, 1, "GS1 General Specifications 21.0.1 Figure 5.7.3-1, explicit mask 101, same as BWIPP", "11111110001000011000101111111" "10000010111011101110101000001" "10111010101011010101001011101" @@ -821,7 +822,7 @@ static void test_qr_encode(int index, int generate, int debug) { "10000010001111101001001010011" "11111110111001001101000010000" }, - /* 13*/ { BARCODE_HIBC_QR, -1, 2, -1, -1, { 0, 0, "" }, "H123ABC01234567890", 0, 21, 21, 1, "ANSI/HIBC 2.6 - 2016 Figure C5 same (mask 001)", + /* 13*/ { BARCODE_HIBC_QR, -1, 0, 2, -1, -1, { 0, 0, "" }, "H123ABC01234567890", -1, 0, 21, 21, 1, "ANSI/HIBC 2.6 - 2016 Figure C5 same (mask 001)", "111111101010001111111" "100000100100101000001" "101110101011001011101" @@ -844,7 +845,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100100101111001" "111111101111011001111" }, - /* 14*/ { BARCODE_HIBC_QR, -1, 2, -1, -1, { 0, 0, "" }, "/EU720060FF0/O523201", 0, 25, 25, 0, "HIBC/PAS Section 2.2 2nd Purchase Order **NOT SAME** uses mask 100 instead of 011; BWIPP uses mask 011", + /* 14*/ { BARCODE_HIBC_QR, -1, 0, 2, -1, -1, { 0, 0, "" }, "/EU720060FF0/O523201", -1, 0, 25, 25, 0, "HIBC/PAS Section 2.2 2nd Purchase Order **NOT SAME** uses mask 100 instead of 011; BWIPP uses mask 011", "1111111011011110101111111" "1000001001001111001000001" "1011101001010010001011101" @@ -871,7 +872,7 @@ static void test_qr_encode(int index, int generate, int debug) { "1000001000010100100011111" "1111111010101101111000001" }, - /* 15*/ { BARCODE_HIBC_QR, -1, 2, -1, 4 << 8, { 0, 0, "" }, "/EU720060FF0/O523201", 0, 25, 25, 1, "HIBC/PAS Section 2.2 2nd Purchase Order same, explicit mask 011", + /* 15*/ { BARCODE_HIBC_QR, -1, 0, 2, -1, 4 << 8, { 0, 0, "" }, "/EU720060FF0/O523201", -1, 0, 25, 25, 1, "HIBC/PAS Section 2.2 2nd Purchase Order same, explicit mask 011", "1111111010011001101111111" "1000001011010011001000001" "1011101000000111001011101" @@ -898,7 +899,7 @@ static void test_qr_encode(int index, int generate, int debug) { "1000001001000001110110101" "1111111011101010111111001" }, - /* 16*/ { BARCODE_HIBC_QR, -1, 2, -1, -1, { 0, 0, "" }, "/KN12345", 0, 21, 21, 1, "HIBC/PAS Section 2.2 Asset Tag **NOT SAME** uses mask 000 instead of 100", + /* 16*/ { BARCODE_HIBC_QR, -1, 0, 2, -1, -1, { 0, 0, "" }, "/KN12345", -1, 0, 21, 21, 1, "HIBC/PAS Section 2.2 Asset Tag **NOT SAME** uses mask 000 instead of 100", "111111100000101111111" "100000101010101000001" "101110100011001011101" @@ -921,7 +922,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100100001100111" "111111101000101110101" }, - /* 17*/ { BARCODE_HIBC_QR, -1, 2, -1, 5 << 8, { 0, 0, "" }, "/KN12345", 0, 21, 21, 1, "HIBC/PAS Section 2.2 Asset Tag, same, explicit mask 100", + /* 17*/ { BARCODE_HIBC_QR, -1, 0, 2, -1, 5 << 8, { 0, 0, "" }, "/KN12345", -1, 0, 21, 21, 1, "HIBC/PAS Section 2.2 Asset Tag, same, explicit mask 100", "111111101010101111111" "100000100111001000001" "101110100110101011101" @@ -944,7 +945,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100110011110101" "111111101010111100111" }, - /* 18*/ { BARCODE_QRCODE, UNICODE_MODE, 1, -1, -1, { 0, 0, "" }, "12345678901234567890123456789012345678901", 0, 21, 21, 1, "Max capacity ECC 1 Version 1 41 numbers", + /* 18*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 1, -1, -1, { 0, 0, "" }, "12345678901234567890123456789012345678901", -1, 0, 21, 21, 1, "Max capacity ECC 1 Version 1 41 numbers", "111111101001001111111" "100000101100101000001" "101110101011101011101" @@ -967,7 +968,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000101000101001010" "111111101010110000111" }, - /* 19*/ { BARCODE_QRCODE, UNICODE_MODE, 2, -1, -1, { 0, 0, "" }, "12345678901234567890123456789012345678901", 0, 25, 25, 1, "ECC 2 auto-sets version 2", + /* 19*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, -1, -1, { 0, 0, "" }, "12345678901234567890123456789012345678901", -1, 0, 25, 25, 1, "ECC 2 auto-sets version 2", "1111111011001110101111111" "1000001001000000001000001" "1011101011001111101011101" @@ -994,7 +995,7 @@ static void test_qr_encode(int index, int generate, int debug) { "1000001000000100111010110" "1111111010011100001100111" }, - /* 20*/ { BARCODE_QRCODE, UNICODE_MODE, 4, 10, -1, { 0, 0, "" }, "点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点", 0, 57, 57, 1, "Max capacity ECC 4 Version 10 74 kanji", + /* 20*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 4, 10, -1, { 0, 0, "" }, "点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点", -1, ZINT_WARN_NONCOMPLIANT, 57, 57, 1, "Max capacity ECC 4 Version 10 74 kanji", "111111100111100000011001000011111100010010011011001111111" "100000100011100101110000101000101001101111000001001000001" "101110101001011100010001111110111100101001100011001011101" @@ -1053,7 +1054,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100110011101110011001101110110101010001101000011011" "111111100010001101010110001001000001001011001001011001011" }, - /* 21*/ { BARCODE_QRCODE, UNICODE_MODE, 4, 27, -1, { 0, 0, "" }, "点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点", 0, 125, 125, 1, "Max capacity ECC 4 Version 27 385 kanji", + /* 21*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 4, 27, -1, { 0, 0, "" }, "点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点", -1, ZINT_WARN_NONCOMPLIANT, 125, 125, 1, "Max capacity ECC 4 Version 27 385 kanji", "11111110101001001100111100100011110001010011110000001100010110100011101010111000011101101001011111001111101101101001101111111" "10000010110001101110011001101111000101001011011001100110101000101010011110000000101000100101101110110000011110100110001000001" "10111010100000000100000101000101111001011001010100100100100000000101100011010001100111101010010101101101101101101101001011101" @@ -1180,7 +1181,7 @@ static void test_qr_encode(int index, int generate, int debug) { "10000010010111001111010001100001010001010110110001100000111101011100000010010111101001001100101101111011011001000001101001110" "11111110000000010001110110000001010111011111000000111111010101110100101000110111000101101011001100000101101101101001100111111" }, - /* 22*/ { BARCODE_QRCODE, UNICODE_MODE, 4, 40, -1, { 0, 0, "" }, "点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点" "点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点", 0, 177, 177, 1, "Max capacity ECC 4 Version 40 784 kanji", + /* 22*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 4, 40, -1, { 0, 0, "" }, "点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点" "点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点", -1, ZINT_WARN_NONCOMPLIANT, 177, 177, 1, "Max capacity ECC 4 Version 40 784 kanji", "111111101010001111111101101110111010110111001110101000010001011011011101001110110011111011010000010101001010011110010000010110111111001001011111101000010010111111001010001111111" "100000101010110001001000101111011001001100100110110000000111110101111011110001101110000111000100101111010011001111100111111001001011011011110011011111111001000010010010101000001" "101110101001001101111001110010010100000000111001001011111000001001111111101010000111011010011010010001111010111001100011000011110100101110001010110001011110011011011010001011101" @@ -1359,7 +1360,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100000010000101110000100011000011110011100010100000011111110010100001100010010001001110010000000110010100111101101010110111111001000101010011011011000011110111110000000000" "111111100000001110110110101010011010010100111111101001111101110111010110101111000111011001110100010111000100111000011011001011010011010011010101111010000011100001000011111011001" }, - /* 23*/ { BARCODE_QRCODE, UNICODE_MODE, 4, -1, ZINT_FULL_MULTIBYTE, { 0, 0, "" }, "áA", 0, 21, 21, 1, "Mask automatic (001)", + /* 23*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 4, -1, ZINT_FULL_MULTIBYTE, { 0, 0, "" }, "áA", -1, 0, 21, 21, 1, "Mask automatic (001)", "111111100101101111111" "100000101001101000001" "101110101010101011101" @@ -1382,7 +1383,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100100111010000" "111111100011001000110" }, - /* 24*/ { BARCODE_QRCODE, UNICODE_MODE, 4, -1, ZINT_FULL_MULTIBYTE | (8 << 8), { 0, 0, "" }, "áA", 0, 21, 21, 1, "Mask 111", + /* 24*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 4, -1, ZINT_FULL_MULTIBYTE | (8 << 8), { 0, 0, "" }, "áA", -1, 0, 21, 21, 1, "Mask 111", "111111101000101111111" "100000101110101000001" "101110100110101011101" @@ -1405,7 +1406,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100011111101000" "111111100111010100101" }, - /* 25*/ { BARCODE_QRCODE, UNICODE_MODE, 4, -1, ZINT_FULL_MULTIBYTE | (9 << 8), { 0, 0, "" }, "áA", 0, 21, 21, 1, "Mask > 111 ignored", + /* 25*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 4, -1, ZINT_FULL_MULTIBYTE | (9 << 8), { 0, 0, "" }, "áA", -1, 0, 21, 21, 1, "Mask > 111 ignored", "111111100101101111111" "100000101001101000001" "101110101010101011101" @@ -1428,7 +1429,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100100111010000" "111111100011001000110" }, - /* 26*/ { BARCODE_QRCODE, UNICODE_MODE, 2, 1, -1, { 0, 0, "" }, "1234567890", 0, 21, 21, 0, "test_print example, automatic mask 001 (same score as mask 010); BWIPP uses mask 010", + /* 26*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, 1, -1, { 0, 0, "" }, "1234567890", -1, 0, 21, 21, 0, "test_print example, automatic mask 001 (same score as mask 010); BWIPP uses mask 010", "111111101001101111111" "100000100100101000001" "101110101001001011101" @@ -1451,7 +1452,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100001011000010" "111111101011111111111" }, - /* 27*/ { BARCODE_QRCODE, UNICODE_MODE, 2, 1, 3 << 8, { 0, 0, "" }, "1234567890", 0, 21, 21, 1, "test_print example, explicit mask 010", + /* 27*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 2, 1, 3 << 8, { 0, 0, "" }, "1234567890", -1, 0, 21, 21, 1, "test_print example, explicit mask 010", "111111100010101111111" "100000100000001000001" "101110101010001011101" @@ -1474,7 +1475,7 @@ static void test_qr_encode(int index, int generate, int debug) { "100000100101111100110" "111111101000100100100" }, - /* 28*/ { BARCODE_QRCODE, UNICODE_MODE, 1, 2, 2 << 8, { 0, 0, "" }, "?ややややwやややや ややややや", 0, 25, 25, 1, "Data with Shift JIS '2nd byte 1st byte' matches; explicit mask 001 (auto 000) to match BWIPP", + /* 28*/ { BARCODE_QRCODE, UNICODE_MODE, -1, 1, 2, 2 << 8, { 0, 0, "" }, "?ややややwやややや ややややや", -1, ZINT_WARN_NONCOMPLIANT, 25, 25, 1, "Data with Shift JIS '2nd byte 1st byte' matches; explicit mask 001 (auto 000) to match BWIPP", "1111111010111110001111111" "1000001011100101001000001" "1011101000111110101011101" @@ -1501,6 +1502,1523 @@ static void test_qr_encode(int index, int generate, int debug) { "1000001010100110000011100" "1111111011001111010111001" }, + /* 29*/ { BARCODE_QRCODE, UNICODE_MODE, 3, 2, -1, -1, { 0, 0, "" }, "sn:7QPB4MN", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 3 Example 1 **NOT SAME** different encodation; BWIPP same encodation as example but uses mask 001 instead of 011", + "111111101111101111111" + "100000101000101000001" + "101110100011001011101" + "101110101001001011101" + "101110100001001011101" + "100000100011101000001" + "111111101010101111111" + "000000001001100000000" + "101101110101101001011" + "101110000011110001101" + "000000110101000100101" + "010111000001000110010" + "001011110000111111000" + "000000001101010110001" + "111111101001110010100" + "100000101000011101011" + "101110100010111111101" + "101110101000001100010" + "101110101000111000000" + "100000100011000001010" + "111111101010111110000" + }, + /* 30*/ { BARCODE_QRCODE, UNICODE_MODE, 3, 2, -1, -1, { 0, 0, "" }, "price:£20.00", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 3 Example 2", + "111111101111101111111" + "100000101101001000001" + "101110100001101011101" + "101110101100101011101" + "101110100101001011101" + "100000100000001000001" + "111111101010101111111" + "000000001101000000000" + "101101110000001001011" + "000010001100101111100" + "101011110111000010110" + "101000010101110100010" + "010100101010111100100" + "000000001101001100001" + "111111101010001111100" + "100000101101000110111" + "101110100001000101101" + "101110101000110101010" + "101110101011011100000" + "100000100101101011110" + "111111101100010111000" + }, + /* 31*/ { BARCODE_QRCODE, UNICODE_MODE, 3, 1, -1, -1, { 0, 0, "" }, "C:\\DOCS\\EXAMPLE.TXT", -1, 0, 25, 25, 0, "AIM ITS/04-023:2022 ECI 3 Example 3 **NOT SAME** different encodation; BWIPP same encodation as Zint but uses mask 000 instead of 100", + "1111111011101001001111111" + "1000001011100010101000001" + "1011101010110001001011101" + "1011101011010111101011101" + "1011101000000100001011101" + "1000001010011100101000001" + "1111111010101010101111111" + "0000000001001001000000000" + "1100111000010110100101111" + "1001100001101010001000010" + "0010111100011110110100010" + "1111000100110100011101010" + "1110111100101101101000111" + "1000000010000110001111001" + "0001011110100001000100111" + "0011010001101011100100010" + "1110001111110110111110001" + "0000000010101001100011001" + "1111111000111110101011100" + "1000001010010101100010101" + "1011101011001101111110001" + "1011101001000111100001001" + "1011101001100001111001110" + "1000001011001010011000001" + "1111111011010111011011111" + }, + /* 32*/ { BARCODE_QRCODE, UNICODE_MODE, 4, 1, -1, -1, { 0, 0, "" }, "Študentska št. 2198390", -1, 0, 25, 25, 0, "AIM ITS/04-023:2022 ECI 4 Example 1 **NOT SAME** different encodation; BWIPP same encodation as Zint but uses mask 011 instead of 100", + "1111111010000110001111111" + "1000001010011110101000001" + "1011101011001111101011101" + "1011101011101011101011101" + "1011101001101010001011101" + "1000001011100100001000001" + "1111111010101010101111111" + "0000000000110110100000000" + "1100111000101010000101111" + "1111100110000001110111011" + "1110111101100010100110011" + "0000000111001010111100111" + "1010101010010110000110000" + "1110110000101000110011010" + "0010001010011011000110001" + "0001100010110000011100110" + "1110011100101110111111001" + "0000000011000111100011001" + "1111111000100001101011000" + "1000001011001001100010110" + "1011101010010111111110011" + "1011101000101011101101001" + "1011101001111111000111010" + "1000001011110101110010101" + "1111111010101100000011011" + }, + /* 33*/ { BARCODE_QRCODE, UNICODE_MODE, 4, 1, -1, -1, { 0, 0, "" }, "Szczegółowe dane kontaktowe:+48 22 694 60 00", -1, 0, 29, 29, 0, "AIM ITS/04-023:2022 ECI 4 Example 2 **NOT SAME** different encodation; BWIPP same encodation as example but uses mask 100 instead of 111", + "11111110000111011111001111111" + "10000010011001101100101000001" + "10111010000010110011101011101" + "10111010100010100010101011101" + "10111010110001101001101011101" + "10000010000111011101001000001" + "11111110101010101010101111111" + "00000000001100110111100000000" + "11000111010100010110100011000" + "11100000010010101001011111100" + "10010111001000101101010000111" + "11001101110010001001101110011" + "10000110010110110101011000001" + "01101101110001100011000111011" + "11001111001111001101000101110" + "10111100100100001111000110011" + "00001010101101001100000100100" + "10010001001011011000000101011" + "11110110011100110001101101010" + "10001101011010000001001111010" + "10110111101010010100111111010" + "00000000111000100001100011101" + "11111110110110010100101010100" + "10000010111100011011100011000" + "10111010001001100101111110001" + "10111010010011011000100101100" + "10111010000001100111000011110" + "10000010110011101010011100110" + "11111110101010100011111001100" + }, + /* 34*/ { BARCODE_QRCODE, UNICODE_MODE, 5, 1, -1, -1, { 0, 0, "" }, "Liĥtenŝtejno", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 5 Example 1; BWIPP uses mask 011 instead of 101", + "111111100111101111111" + "100000100101001000001" + "101110100100001011101" + "101110101111001011101" + "101110101010101011101" + "100000100010101000001" + "111111101010101111111" + "000000000110100000000" + "110001110100100011000" + "111011000001010001101" + "100100111011011010111" + "100101010110011011000" + "100011101010110011111" + "000000001100010101100" + "111111101001011000010" + "100000101010011000011" + "101110100011100001110" + "101110100000010000000" + "101110100111010010011" + "100000101010010111111" + "111111101011110000010" + }, + /* 35*/ { BARCODE_QRCODE, UNICODE_MODE, 6, 1, -1, -1, { 0, 0, "" }, "Lietuvą", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 6 Example 1", + "111111101000101111111" + "100000101010001000001" + "101110100000101011101" + "101110100000001011101" + "101110101111101011101" + "100000101101101000001" + "111111101010101111111" + "000000001000100000000" + "111001101010011110011" + "111111001101001011011" + "100011101001100011101" + "000011011001000111100" + "110100101001101011111" + "000000001110000101000" + "111111100010011011001" + "100000101010100110101" + "101110100110011010101" + "101110100001011001000" + "101110101101110011011" + "100000101011011111011" + "111111101111111010101" + }, + /* 36*/ { BARCODE_QRCODE, UNICODE_MODE, 7, 1, -1, -1, { 0, 0, "" }, "Россия", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 7 Example 1", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "101000010001010010111" + "110010110011011110101" + "101011010000111110011" + "100001101011001100101" + "000000001010011110100" + "111111101001101000110" + "100000100110001000101" + "101110100000111110001" + "101110101010011001111" + "101110100111011010001" + "100000101011100101011" + "111111101100010100110" + }, + /* 37*/ { BARCODE_QRCODE, UNICODE_MODE, 7, 1, -1, -1, { 0, 0, "" }, "Монголулс", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 7 Example 2; BWIPP uses mask 000 instead of 111", + "111111100101101111111" + "100000101101001000001" + "101110101100101011101" + "101110100101001011101" + "101110101000101011101" + "100000101001101000001" + "111111101010101111111" + "000000001111100000000" + "110100110110001110110" + "111110010000001011100" + "010110100010110011010" + "100000011011011001111" + "000011110010110100101" + "000000001101011100100" + "111111101010010100110" + "100000100001111000101" + "101110100001000110001" + "101110101110000011111" + "101110100110100011101" + "100000101011000010111" + "111111101001110100110" + }, + /* 38*/ { BARCODE_QRCODE, UNICODE_MODE, 8, 1, -1, -1, { 0, 0, "" }, "جواز السفر", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 8 Example 1", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "010000010011001010111" + "100011101101010100110" + "111110010000101101111" + "100010100111001100101" + "000000001101011110100" + "111111101011110011010" + "100000100001010111110" + "101110100010100000110" + "101110101011000111111" + "101110100000100010101" + "100000101110000010011" + "111111101000010100010" + }, + /* 39*/ { BARCODE_QRCODE, UNICODE_MODE, 8, 1, -1, -1, { 0, 0, "" }, "المنشأ: المملكة العربية السعودية", -1, 0, 29, 29, 0, "AIM ITS/04-023:2022 ECI 8 Example 2; BWIPP uses mask 000 instead of 010", + "11111110001011110110001111111" + "10000010101001111101001000001" + "10111010000011010110101011101" + "10111010111010110111101011101" + "10111010010000011110001011101" + "10000010110110000000101000001" + "11111110101010101010101111111" + "00000000011100101110100000000" + "11111011110100000011110101010" + "10000100101011110000000111110" + "11110011101001110111101000100" + "10001100000011010010111101011" + "00001011111010111011000011001" + "00000001110000010110100111101" + "01101010010110000000001000100" + "01101100101100111011111101010" + "00001111001100000101100100101" + "10110100000011100101110111110" + "10001110001001100100001011010" + "10000101111011001010111101011" + "10011010001010101001111110010" + "00000000110000001110100011110" + "11111110110110000000101010000" + "10000010001100111000100010010" + "10111010101100000110111111111" + "10111010101011110100110010010" + "10111010100001100000001011110" + "10000010100011001101001000101" + "11111110110010101010110010100" + }, + /* 40*/ { BARCODE_QRCODE, UNICODE_MODE, 9, 1, -1, -1, { 0, 0, "" }, "Μέρος #. α123", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 9 Example 1 **NOT SAME** example uses mask 111 instead of 000", + "111111100100101111111" + "100000100111001000001" + "101110101100101011101" + "101110100101001011101" + "101110100011001011101" + "100000100001101000001" + "111111101010101111111" + "000000001100100000000" + "111011111111111000100" + "101100010001010100111" + "101101101011000010100" + "100010000101010110110" + "010111101110110010101" + "000000001001010110110" + "111111101000100011111" + "100000101000001010100" + "101110101100100101100" + "101110100010010010110" + "101110101010100101001" + "100000101111110111001" + "111111101101001101111" + }, + /* 41*/ { BARCODE_QRCODE, UNICODE_MODE, 9, 1, -1, 8 << 8, { 0, 0, "" }, "Μέρος #. α123", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 9 Example 1 with explicit mask 111; BWIPP uses mask 000", + "111111100100101111111" + "100000101101001000001" + "101110101101101011101" + "101110100101001011101" + "101110101001001011101" + "100000101000101000001" + "111111101010101111111" + "000000001110100000000" + "110100110110101110110" + "101100010001010100111" + "111111111001010000110" + "101011001100011111111" + "010111101110110010101" + "000000001011000100100" + "111111101001101010110" + "100000100000001010100" + "101110100110110111110" + "101110101011011011111" + "101110100010100101001" + "100000101101100101011" + "111111101100000100110" + }, + /* 42*/ { BARCODE_QRCODE, UNICODE_MODE, 10, 1, -1, -1, { 0, 0, "" }, "דרכון", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 10 Example 1; BWIPP uses mask 000 instead of 101", + "111111100000101111111" + "100000100010101000001" + "101110100011101011101" + "101110101010101011101" + "101110101100101011101" + "100000100101001000001" + "111111101010101111111" + "000000000000000000000" + "110001110001000011000" + "101110010001110011011" + "001110111110101100010" + "011100010001111000100" + "010100111101111110011" + "000000001100100111000" + "111111101111010011010" + "100000101100001000000" + "101110100001010010101" + "101110100101111101000" + "101110100001110011011" + "100000101111111010011" + "111111101110100011010" + }, + /* 43*/ { BARCODE_QRCODE, UNICODE_MODE, 10, 1, -1, -1, { 0, 0, "" }, "מספר חלק: A20200715001", -1, 0, 25, 25, 0, "AIM ITS/04-023:2022 ECI 10 Example 2 **NOT SAME** different encodation; BWIPP uses mask 000 instead of 100", + "1111111011101100001111111" + "1000001011100001001000001" + "1011101010110001001011101" + "1011101011010000001011101" + "1011101000000110001011101" + "1000001010011010001000001" + "1111111010101010101111111" + "0000000001001001100000000" + "1100111000010110000101111" + "1011100011101011010011100" + "0001001000011110110110001" + "0111110010110101001111111" + "1001111010101101000111010" + "1001010100000110100001110" + "0011011100100000110010011" + "0001110001101010111110110" + "1111011000010110111110001" + "0000000010101000100011101" + "1111111001111111101010000" + "1000001010010101100011011" + "1011101010001100111110000" + "1011101001000111001000001" + "1011101001000001110101010" + "1000001011001010100011101" + "1111111011010110001000011" + }, + /* 44*/ { BARCODE_QRCODE, UNICODE_MODE, 11, 1, -1, -1, { 0, 0, "" }, "Amerika Birleşik Devletleri", -1, 0, 25, 25, 1, "AIM ITS/04-023:2022 ECI 11 Example 1", + "1111111000111100101111111" + "1000001001101101001000001" + "1011101000001000101011101" + "1011101010000010001011101" + "1011101011001001001011101" + "1000001000011011001000001" + "1111111010101010101111111" + "0000000000110001100000000" + "1100011101001011000011000" + "1010000001011011001011111" + "0101111100100110111011101" + "0011010001010001101001101" + "1000001111010100011010101" + "1110010010000010100001010" + "1001101010001111011011100" + "1001000001110001000111111" + "1011111100001111111110001" + "0000000010100000100011001" + "1111111011001001101010001" + "1000001010110101100010010" + "1011101001101010111111100" + "1011101000100010000101101" + "1011101001000110011011101" + "1000001010110000111010110" + "1111111010110101100010101" + }, + /* 45*/ { BARCODE_QRCODE, UNICODE_MODE, 11, 1, -1, -1, { 0, 0, "" }, "Biniş kartı #120921039", -1, 0, 25, 25, 0, "AIM ITS/04-023:2022 ECI 11 Example 2 **NOT SAME** different encodation; BWIPP same encodation as Zint but uses mask 101 instead of 111", + "1111111000100110101111111" + "1000001011100110001000001" + "1011101010000001001011101" + "1011101001001011001011101" + "1011101011101110101011101" + "1000001010101101001000001" + "1111111010101010101111111" + "0000000010110000100000000" + "1101001100011100101110110" + "0011000111011101000100011" + "1111101100011000111100101" + "0101010011111101011011100" + "0001011110110010001101111" + "0101100100010100111010100" + "1011001100010110101010000" + "0111000011010000001000110" + "1110001000101100111110101" + "0000000010101111100010000" + "1111111010011010101010011" + "1000001001001011100011001" + "1011101000100000111111110" + "1011101010010011100100110" + "1011101000100000001111101" + "1000001011100010011100111" + "1111111010001001010010011" + }, + /* 46*/ { BARCODE_QRCODE, UNICODE_MODE, 12, 1, -1, -1, { 0, 0, "" }, "Kūrybiškumą", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 12 Example 1; BWIPP uses mask 111 instead of 100", + "111111101111101111111" + "100000101010101000001" + "101110101000001011101" + "101110101111001011101" + "101110100000101011101" + "100000101101001000001" + "111111101010101111111" + "000000000111100000000" + "110011100101000101111" + "100110001010110101100" + "010011100011011101001" + "000000001101001101100" + "001101101010110101011" + "000000001101101010011" + "111111100101001110110" + "100000101100101100100" + "101110101110000100000" + "101110100111101101111" + "101110100100111100100" + "100000101011110001011" + "111111101001101100001" + }, + /* 47*/ { BARCODE_QRCODE, UNICODE_MODE, 13, 1, -1, -1, { 0, 0, "" }, "บาร๋แค่ด", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 13 Example 1; BWIPP uses mask 001 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "011110001111001101110" + "101100111101010101010" + "001101001100110110111" + "010011101111001000001" + "000000001100001010100" + "111111101111111010110" + "100000100110000111000" + "101110100010111110000" + "101110101000011011111" + "101110100111001000101" + "100000101011100101011" + "111111101010000100010" + }, + /* 48*/ { BARCODE_QRCODE, UNICODE_MODE, 15, 1, -1, -1, { 0, 0, "" }, "uzņēmums", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 15 Example 1; BWIPP uses mask 011 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "110000001011000000010" + "000011101101010101010" + "011011001110100011011" + "000010110011011111101" + "000000001100010010000" + "111111101101111100010" + "100000100000010111101" + "101110100110100100000" + "101110101110011011111" + "101110100111001111001" + "100000101111100101011" + "111111101000000101010" + }, + /* 49*/ { BARCODE_QRCODE, UNICODE_MODE, 16, 1, -1, -1, { 0, 0, "" }, "ṁórṡáċ", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 16 Example 1; BWIPP uses mask 001 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "000100000111010001111" + "011010111101011101001" + "001001001000111111011" + "110111110011001001101" + "000000001100011010100" + "111111101001101010010" + "100000100010001111010" + "101110100100111111011" + "101110101000011011001" + "101110100111011101001" + "100000101101100001011" + "111111101010010001010" + }, + /* 50*/ { BARCODE_QRCODE, UNICODE_MODE, 17, 1, -1, -1, { 0, 0, "" }, "Price: €13.50", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 17 Example 1", + "111111100100101111111" + "100000101101001000001" + "101110101101101011101" + "101110100101001011101" + "101110101000101011101" + "100000101000001000001" + "111111101010101111111" + "000000001110100000000" + "110100110111101110110" + "100010000000010110000" + "100010101001110011100" + "101110010101111010011" + "011001111010101010101" + "000000001101101010000" + "111111101000001110010" + "100000100111100111000" + "101110100110111100011" + "101110101011111011001" + "101110100100110010001" + "100000101000100101111" + "111111101101110110110" + }, + /* 51*/ { BARCODE_QRCODE, UNICODE_MODE, 18, 1, -1, -1, { 0, 0, "" }, "Te słowa są głębokie", -1, 0, 25, 25, 0, "AIM ITS/04-023:2022 ECI 18 Example 1; BWIPP uses mask 001 instead of 100", + "1111111010000111001111111" + "1000001010011000001000001" + "1011101011001100001011101" + "1011101011101111001011101" + "1011101001101100101011101" + "1000001011100001101000001" + "1111111010101010101111111" + "0000000000110100000000000" + "1100111000101011100101111" + "0001100010000101011111001" + "1010101111100111010011000" + "1010100011001100111100100" + "1101011110010111101001011" + "1001100100101101101010001" + "0011101111111111100111000" + "0011100111110000001101100" + "1100101100101100111110001" + "0000000011100100100011001" + "1111111000100001101010000" + "1000001010001001100011111" + "1011101011010110111111101" + "1011101001101010101000111" + "1011101000011111101110010" + "1000001011110101011011101" + "1111111010001100000011111" + }, + /* 52*/ { BARCODE_QRCODE, UNICODE_MODE, 20, 1, -1, -1, { 0, 0, "" }, "バーコード", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 20 Example 1; BWIPP uses mask 011 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "101011011011011001000" + "110011111001000000101" + "000111011100111101111" + "100111110011001011101" + "000000001000011110000" + "111111101101110110001" + "100000100110000111110" + "101110100110111000101" + "101110101000011010001" + "101110100011001010101" + "100000101011100110011" + "111111101010000101010" + }, + /* 53*/ { BARCODE_QRCODE, UNICODE_MODE, 20, 1, -1, -1, { 0, 0, "" }, "東京都", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 20 Example 2; BWIPP uses mask 000 instead of 100", + "111111101111101111111" + "100000101010101000001" + "101110101000001011101" + "101110101111001011101" + "101110100000101011101" + "100000101101001000001" + "111111101010101111111" + "000000000111100000000" + "110011100101000101111" + "011110011101100001100" + "111011100111001111100" + "101110011100011110100" + "010010111000111000011" + "000000001100111011111" + "111111100000110011101" + "100000101001100101000" + "101110101101001101101" + "101110100011100111001" + "101110100101001100100" + "100000101010011010011" + "111111101100111011001" + }, + /* 54*/ { BARCODE_QRCODE, UNICODE_MODE, 21, 1, -1, -1, { 0, 0, "" }, "Študentska št. 2198390", -1, 0, 25, 25, 1, "AIM ITS/04-023:2022 ECI 21 Example 1 **NOT SAME** different encodation", + "1111111010000110001111111" + "1000001010011110101000001" + "1011101011001111101011101" + "1011101011101011101011101" + "1011101001101010001011101" + "1000001011100100001000001" + "1111111010101010101111111" + "0000000000110110100000000" + "1100111000101010000101111" + "1000000010000001110111000" + "1001011011100010100110011" + "0110100101001010111100110" + "1111111100010110000110000" + "1011000111101000110011010" + "0000001011011011000110001" + "0011000100010000011100110" + "1101101101001110111111001" + "0000000011000110100011001" + "1111111001100000101011000" + "1000001011001001100010100" + "1011101011110111111110011" + "1011101001001011001101011" + "1011101001011111000111010" + "1000001010010101110010101" + "1111111010101100000011011" + }, + /* 55*/ { BARCODE_QRCODE, UNICODE_MODE, 22, 1, -1, -1, { 0, 0, "" }, "Россия", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 22 Example 1", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "101000001111010010111" + "011101110101011111101" + "110011010010111010011" + "101010101111001100101" + "000000001000011110100" + "111111101001101001010" + "100000100010001110111" + "101110100000111110001" + "101110101010011001101" + "101110100011011011001" + "100000101001100001011" + "111111101100010100110" + }, + /* 56*/ { BARCODE_QRCODE, UNICODE_MODE, 22, 1, -1, -1, { 0, 0, "" }, "Монголулс", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 22 Example 2; BWIPP uses mask 000 instead of 100", + "111111101111101111111" + "100000101010101000001" + "101110101000001011101" + "101110101111001011101" + "101110100000101011101" + "100000101101001000001" + "111111101010101111111" + "000000000111100000000" + "110011100101000101111" + "110010000001100111001" + "101001110101011101001" + "011011001100000100100" + "110110111100100110111" + "000000001100100011011" + "111111100000101001110" + "100000101011101100101" + "101110101111000110001" + "101110100110100111001" + "101110100101011111100" + "100000101001000100111" + "111111101000101111101" + }, + /* 57*/ { BARCODE_QRCODE, UNICODE_MODE, 23, 1, -1, -1, { 0, 0, "" }, "bœuf", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 23 Example 1; BWIPP uses mask 000 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "010001001111010100010" + "010001100011001110001" + "111111001100111110011" + "010100110101011100001" + "000000001010011111100" + "111111101011101010110" + "100000100100001100101" + "101110100110111000101" + "101110101100011111001" + "101110100101011111001" + "100000101001100100011" + "111111101000010110110" + }, + /* 58*/ { BARCODE_QRCODE, UNICODE_MODE, 24, 1, -1, -1, { 0, 0, "" }, "جواز السفر", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 24 Example 1", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100101101011101" + "100000100111001000001" + "111111101010101111111" + "000000001010000000000" + "111011111010111000100" + "001010011111001010111" + "101100101101000110100" + "100010010001110100110" + "100111110011011100101" + "000000001011001100110" + "111111101010111010011" + "100000101001010110010" + "101110101110110010000" + "101110100010001110100" + "101110101100111010101" + "100000101010001000001" + "111111101101011101011" + }, + /* 59*/ { BARCODE_QRCODE, UNICODE_MODE, 24, 1, -1, -1, { 0, 0, "" }, "المنشأ: المملكة العربية السعودية", -1, 0, 29, 29, 0, "AIM ITS/04-023:2022 ECI 24 Example 2; BWIPP uses mask 000 instead of 100", + "11111110111010000111101111111" + "10000010111000001100101000001" + "10111010101101011000101011101" + "10111010110100111111101011101" + "10111010000001101101101011101" + "10000010100111110001001000001" + "11111110101010101010101111111" + "00000000010010100000100000000" + "11001110000101110010100101111" + "10011100111010000000111010010" + "10011111000111111001100110111" + "11111101101101011100110010010" + "01010011101011001010000110011" + "01100001000001100111111010011" + "01001010010000001110000110101" + "01111000100010110101110011011" + "10100011111101111100000101111" + "11111101001010001100010110000" + "00010110111111101010000101011" + "00001000110101000100101011010" + "11101010100011011010111111100" + "00000000110001111101100010000" + "11111110000000001110101010001" + "10000010110010110110100010011" + "10111010111101110111111110001" + "10111010011010011101011011110" + "10111010010111111110000101111" + "10000010111101000011000110100" + "11111110111011010111000011010" + }, + /* 60*/ { BARCODE_QRCODE, UNICODE_MODE, 25, 1, -1, -1, { 0, 0, "" }, "条码", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 25 Example 1", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100101101011101" + "100000100111001000001" + "111111101010101111111" + "000000001010000000000" + "111011111010111000100" + "000001010011010100010" + "010011110001011100011" + "100001001011110110010" + "001100101101011101001" + "000000001100001100010" + "111111101010100010011" + "100000101110001101000" + "101110101100101011100" + "101110100001010000000" + "101110101001011011001" + "100000101011110101101" + "111111101111011010111" + }, + /* 61*/ { BARCODE_QRCODE, UNICODE_MODE, 25, 1, -1, -1, { 0, 0, "" }, "バーコード", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 25 Example 2; BWIPP uses mask 000 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "011011010111010011011" + "110010110011000001010" + "111100010110111010011" + "000001100011001000101" + "000000001001011110100" + "111111101001111010110" + "100000100001001011000" + "101110100100111000110" + "101110101001011100001" + "101110100000010101001" + "100000101001000001011" + "111111101110000101110" + }, + /* 62*/ { BARCODE_QRCODE, UNICODE_MODE, 25, 1, -1, -1, { 0, 0, "" }, "바코드", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 25 Example 3", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100101101011101" + "100000100111001000001" + "111111101010101111111" + "000000001010000000000" + "111011111010111000100" + "011011000011010101111" + "110010110001001101011" + "011111001111110000110" + "100010110011001100101" + "000000001100001101010" + "111111101100100111111" + "100000101100001010000" + "101110101010101000100" + "101110100001010100100" + "101110101011011110101" + "100000101101110000101" + "111111101001011111011" + }, + /* 63*/ { BARCODE_QRCODE, UNICODE_MODE, 26, 1, -1, -1, { 0, 0, "" }, "条码", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 26 Example 1; BWIPP uses mask 000 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "010111001111010000111" + "111010100011011000001" + "111010010000111101011" + "011001110101001000001" + "000000001100011111100" + "111111101111101010110" + "100000100110001110111" + "101110100010111011110" + "101110101110011010101" + "101110100011011110001" + "100000101111100101011" + "111111101110010100110" + }, + /* 64*/ { BARCODE_QRCODE, UNICODE_MODE, 26, 2, -1, -1, { 0, 0, "" }, "バーコード", -1, 0, 25, 25, 0, "AIM ITS/04-023:2022 ECI 26 Example 2; BWIPP uses mask 101 instead of 010", + "1111111001111101001111111" + "1000001001001111001000001" + "1011101011101101001011101" + "1011101011111011101011101" + "1011101010011001001011101" + "1000001010100000001000001" + "1111111010101010101111111" + "0000000010100011000000000" + "1011111001011000101111100" + "0000010010010110000001110" + "0110001111000111000001001" + "1010010010111101010011000" + "1111111010111010101110110" + "1000110001100000010001110" + "1001011111111001010010010" + "1010100110110010100111001" + "1010101001110000111111001" + "0000000011001111100010101" + "1111111001000111101011111" + "1000001011001100100011000" + "1011101010101010111110100" + "1011101011100000101001111" + "1011101010011001110111001" + "1000001001110010100111010" + "1111111010110001001010111" + }, + /* 65*/ { BARCODE_QRCODE, UNICODE_MODE, 26, 2, -1, -1, { 0, 0, "" }, "바코드", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 26 Example 3; BWIPP uses mask 111 instead of 001", + "111111101011001111111" + "100000100001001000001" + "101110101100101011101" + "101110100001001011101" + "101110100111101011101" + "100000101001101000001" + "111111101010101111111" + "000000000110100000000" + "101000110110000100101" + "111001010101011001110" + "110010100011110011010" + "010000010011001100100" + "010101100111100100011" + "000000001110001100100" + "111111101110001000001" + "100000100010100110001" + "101110100110000101110" + "101110100100001000110" + "101110101011101000111" + "100000100010011011011" + "111111101011111001101" + }, + /* 66*/ { BARCODE_QRCODE, UNICODE_MODE, 27, 2, -1, -1, { 0, 0, "" }, "sn:7QPB4MN", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 27 Example 1 **NOT SAME** different encodation; BWIPP same encodation as example but uses mask 111 instead of 010", + "111111101010101111111" + "100000101111101000001" + "101110100110001011101" + "101110101110101011101" + "101110100101001011101" + "100000100011101000001" + "111111101010101111111" + "000000001101100000000" + "101101110111101001011" + "000110001101110001101" + "100000100001000100101" + "100111000011000110010" + "010011101010111111000" + "000000001011010110001" + "111111101101110010100" + "100000101100011101011" + "101110100010111111100" + "101110101010001100000" + "101110101110111000000" + "100000100011000001010" + "111111101000111110000" + }, + /* 67*/ { BARCODE_QRCODE, UNICODE_MODE, 28, 1, -1, -1, { 0, 0, "" }, "條碼", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 28 Example 1", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100101101011101" + "100000100111001000001" + "111111101010101111111" + "000000001010000000000" + "111011111010111000100" + "000101001011010101110" + "000000101101011101011" + "100101001011110111010" + "010001100101011101101" + "000000001000001100110" + "111111101000100011011" + "100000101110001101110" + "101110101100101010110" + "101110100011010101100" + "101110101001011001001" + "100000101101110000101" + "111111101101011111111" + }, + /* 68*/ { BARCODE_QRCODE, UNICODE_MODE, 29, 1, -1, -1, { 0, 0, "" }, "条码", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 29 Example 1", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100101101011101" + "100000100111001000001" + "111111101010101111111" + "000000001010000000000" + "111011111010111000100" + "100001010001010100110" + "110111111101011100111" + "000011001001110110110" + "001101101111011100101" + "000000001000001100110" + "111111101100100011011" + "100000101110001100000" + "101110101000101011110" + "101110100011010010100" + "101110101101011000101" + "100000101111110111001" + "111111101101011100011" + }, + /* 69*/ { BARCODE_QRCODE, UNICODE_MODE, 29, 1, -1, -1, { 0, 0, "" }, "北京", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 29 Example 2", + "111111100100101111111" + "100000101001001000001" + "101110100100001011101" + "101110101001001011101" + "101110100011101011101" + "100000101110101000001" + "111111101010101111111" + "000000000011100000000" + "111110111100110101010" + "001011001010100100000" + "010100101111010011010" + "011101010100000110100" + "001010110001010011100" + "000000001101111100000" + "111111101010101101010" + "100000100111111100110" + "101110101100100101111" + "101110101000100000010" + "101110101101010111000" + "100000101100000111011" + "111111101011010110010" + }, + /* 70*/ { BARCODE_QRCODE, UNICODE_MODE, 30, 1, -1, -1, { 0, 0, "" }, "바코드", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 30 Example 1; BWIPP uses mask 000 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "000010000001010001111" + "000111110001011101001" + "001010010010111110111" + "100110110111001101101" + "000000001000011010100" + "111111101101101110110" + "100000100110001011111" + "101110100010111011100" + "101110101110011111101" + "101110100001011000101" + "100000101001100010011" + "111111101110010101110" + }, + /* 71*/ { BARCODE_QRCODE, UNICODE_MODE, 30, 1, -1, -1, { 0, 0, "" }, "서울", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 30 Example 2", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100101101011101" + "100000100111001000001" + "111111101010101111111" + "000000001010000000000" + "111011111010111000100" + "110000001101010101110" + "011011110001011101011" + "100111001111110110110" + "000000101101011100101" + "000000001100001101110" + "111111101000100010011" + "100000101110001100111" + "101110101100101011110" + "101110100001010011100" + "101110101001011101001" + "100000101001110110101" + "111111101011011101011" + }, + /* 72*/ { BARCODE_QRCODE, UNICODE_MODE, 31, 1, -1, -1, { 0, 0, "" }, "条码", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 31 Example 1", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100101101011101" + "100000100111001000001" + "111111101010101111111" + "000000001010000000000" + "111011111010111000100" + "100011011101010100110" + "001000101111011100111" + "111101011011110110110" + "011100111111011100101" + "000000001100001100110" + "111111101010100011011" + "100000101000001100001" + "101110101010101011110" + "101110100011010010100" + "101110101001011000101" + "100000101011110111001" + "111111101101011100011" + }, + /* 73*/ { BARCODE_QRCODE, UNICODE_MODE, 31, 1, -1, -1, { 0, 0, "" }, "北京", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 31 Example 2; BWIPP uses mask 011 instead of 010", + "111111100100101111111" + "100000101001001000001" + "101110100100001011101" + "101110101001001011101" + "101110100011101011101" + "100000101110101000001" + "111111101010101111111" + "000000000011100000000" + "111110111100110101010" + "001001000110100100000" + "101011111101010011010" + "100011000110000110100" + "011011100001010011100" + "000000001001111100000" + "111111101100101101010" + "100000100001111100111" + "101110101110100101111" + "101110101000100000010" + "101110101001010111000" + "100000101000000111011" + "111111101011010110010" + }, + /* 74*/ { BARCODE_QRCODE, UNICODE_MODE, 31, 1, -1, -1, { 0, 0, "" }, "條碼", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 31 Example 3", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100101101011101" + "100000100111001000001" + "111111101010101111111" + "000000001010000000000" + "111011111010111000100" + "000100011111010101110" + "000100110101011101111" + "011101011001110110010" + "110010111001011101001" + "000000001000001100010" + "111111101010100010011" + "100000101010001100101" + "101110101110101010110" + "101110100001010001100" + "101110101101011011001" + "100000101001110110001" + "111111101111011110111" + }, + /* 75*/ { BARCODE_QRCODE, UNICODE_MODE, 32, 1, -1, -1, { 0, 0, "" }, "条码", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 32 Example 1", + "111111100100101111111" + "100000101001001000001" + "101110100100001011101" + "101110101001001011101" + "101110100011101011101" + "100000101110101000001" + "111111101010101111111" + "000000000011100000000" + "111110111100110101010" + "100111001100100101000" + "110011110101010010110" + "101111010110000111000" + "100010101001010010100" + "000000001101111101000" + "111111101000101101010" + "100000100111111101100" + "101110101010100101100" + "101110101110100011001" + "101110101011010110100" + "100000101100000110111" + "111111101111010010010" + }, + /* 76*/ { BARCODE_QRCODE, UNICODE_MODE, 32, 1, -1, -1, { 0, 0, "" }, "北京", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 32 Example 2; BWIPP uses mask 011 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "001101010111010101110" + "000010110101001111001" + "111000000010111110011" + "100101110111011101101" + "000000001010011111100" + "111111101111101010010" + "100000100110001101010" + "101110100100111001111" + "101110101100011000110" + "101110100011011001001" + "100000101101100100111" + "111111101000010001010" + }, + /* 77*/ { BARCODE_QRCODE, UNICODE_MODE, 32, 1, -1, -1, { 0, 0, "" }, "條碼", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 32 Example 3; BWIPP uses mask 011 instead of 001", + "111111101111101111111" + "100000101101101000001" + "101110100111001011101" + "101110100101101011101" + "101110101000101011101" + "100000101010001000001" + "111111101010101111111" + "000000001111000000000" + "111001101111111110011" + "100100001010000000100" + "100100110100001000101" + "101011010000100011000" + "010111110100001000011" + "000000001101011001000" + "111111100011110111001" + "100000101001011001100" + "101110100101111111111" + "101110100000000100101" + "101110101100001110011" + "100000101010100011011" + "111111101110001011101" + }, + /* 78*/ { BARCODE_QRCODE, UNICODE_MODE, 32, 1, -1, -1, { 0, 0, "" }, "པེ་ཅིང།", -1, 0, 25, 25, 1, "AIM ITS/04-023:2022 ECI 32 Example 4", + "1111111011110110001111111" + "1000001000011010101000001" + "1011101010110101101011101" + "1011101011000001101011101" + "1011101011010001101011101" + "1000001001010001101000001" + "1111111010101010101111111" + "0000000001001001100000000" + "1111001010010001110011101" + "0101100111011100000101011" + "1111001000011100111101110" + "0011010100010111100100100" + "1000111001000101101001100" + "0111000001110000000111110" + "0100101011000000100011011" + "1001000110001111010111011" + "0000111000000011111110010" + "0000000011110001100010100" + "1111111001100001101010111" + "1000001001100011100010110" + "1011101001001100111110100" + "1011101011110010101011100" + "1011101011100110011010010" + "1000001010111111111010111" + "1111111010011101100000011" + }, + /* 79*/ { BARCODE_QRCODE, UNICODE_MODE, 32, 1, -1, -1, { 0, 0, "" }, "バーコード", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 32 Example 5; BWIPP uses mask 011 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "110111001101011011111" + "101101100111010000010" + "000110011000110011011" + "111110100101011001101" + "000000001011010010100" + "111111101101101110110" + "100000100011010111010" + "101110100000111010111" + "101110101011010100110" + "101110100010000010001" + "100000101001010101111" + "111111101110010110110" + }, + /* 80*/ { BARCODE_QRCODE, UNICODE_MODE, 32, 1, -1, -1, { 0, 0, "" }, "바코드", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 32 Example 6; BWIPP uses mask 011 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101110101011101" + "100000101110001000001" + "111111101010101111111" + "000000001001000000000" + "110100110011101110110" + "100110010010101101110" + "100011100010110100100" + "111110001111101010011" + "101000110100111011001" + "000000001111100001000" + "111111101110111010010" + "100000100010111101010" + "101110100000001010111" + "101110101001010001110" + "101110100100001011001" + "100000101110100001011" + "111111101101101010110" + }, + /* 81*/ { BARCODE_QRCODE, UNICODE_MODE, 33, 1, -1, -1, { 0, 0, "" }, "条码", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 33 Example 1; BWIPP uses mask 111 instead of 010", + "111111100100101111111" + "100000101001001000001" + "101110100100001011101" + "101110101001001011101" + "101110100011101011101" + "100000101110101000001" + "111111101010101111111" + "000000000011100000000" + "111110111100110101010" + "110010000100100101100" + "000001111101010010010" + "110101000100000110100" + "001111101111010011100" + "000000001011111101100" + "111111101000101100010" + "100000100001111101110" + "101110101110100101000" + "101110101010100100101" + "101110101111010110100" + "100000101010000010111" + "111111101101010001110" + }, + /* 82*/ { BARCODE_QRCODE, UNICODE_MODE, 33, 1, -1, -1, { 0, 0, "" }, "バーコード", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 33 Example 2", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100101101011101" + "100000100111001000001" + "111111101010101111111" + "000000001010000000000" + "111011111010111000100" + "011110010011001100111" + "111100101001010011100" + "010000011111101011010" + "010000111111001010101" + "000000001101010011010" + "111111101100110011011" + "100000101101010011000" + "101110101110101000101" + "101110100101001100111" + "101110101100101011001" + "100000101100111010101" + "111111101110111010111" + }, + /* 83*/ { BARCODE_QRCODE, UNICODE_MODE, 33, 1, -1, -1, { 0, 0, "" }, "바코드", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 33 Example 3; BWIPP uses mask 000 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "111111011101010101011" + "010100100001011101101" + "101101001110111011011" + "001101111001001000101" + "000000001110011111100" + "111111101001101100010" + "100000100110001000100" + "101110100010111110111" + "101110101100011011010" + "101110100101011101101" + "100000101111100110011" + "111111101000010101110" + }, + /* 84*/ { BARCODE_QRCODE, UNICODE_MODE, 34, 1, -1, -1, { 0, 0, "" }, "条码", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 34 Example 1", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "001000011111000101010" + "000111110001000000110" + "010001000010110100011" + "000000111011001010101" + "000000001110000111000" + "111111101101100011110" + "100000100000010101011" + "101110100000101000111" + "101110101110011001010" + "101110100011001010001" + "100000101011100100011" + "111111101110000110010" + }, + /* 85*/ { BARCODE_QRCODE, UNICODE_MODE, 34, 1, -1, -1, { 0, 0, "" }, "バーコード", -1, 0, 25, 25, 1, "AIM ITS/04-023:2022 ECI 34 Example 2", + "1111111000100010001111111" + "1000001001000100101000001" + "1011101010010011001011101" + "1011101001001100001011101" + "1011101001001010101011101" + "1000001000111101101000001" + "1111111010101010101111111" + "0000000010010100000000000" + "1110111110001010111000100" + "1101000011011101010011010" + "1111111100111110101100101" + "1001010011101111010011010" + "0011101010110010101010101" + "0110100100110001010101010" + "1011101001100000101101011" + "0100110111010001010101000" + "1011111001101010111110101" + "0000000010111110100010110" + "1111111010111011101011111" + "1000001011001101100011011" + "1011101010010010111110101" + "1011101001110000110101011" + "1011101011000100001010101" + "1000001010110001010101001" + "1111111010001000110010111" + }, + /* 86*/ { BARCODE_QRCODE, UNICODE_MODE, 34, 1, -1, -1, { 0, 0, "" }, "바코드", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 34 Example 3", + "111111100010101111111" + "100000100000101000001" + "101110101010001011101" + "101110100000101011101" + "101110100100101011101" + "100000100111001000001" + "111111101010101111111" + "000000001011000000000" + "111011111010111000100" + "001101000001001101010" + "101010100101001010110" + "010101011000001101010" + "100001100001010010101" + "000000001001000101010" + "111111101001111010111" + "100000101010100101011" + "101110101110001010101" + "101110100001010101111" + "101110101000101111001" + "100000101101010000101" + "111111101010101010111" + }, + /* 87*/ { BARCODE_QRCODE, UNICODE_MODE, 35, 1, -1, -1, { 0, 0, "" }, "条码", -1, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 35 Example 1", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101111101011101" + "100000101110001000001" + "111111101010101111111" + "000000001000000000000" + "110100110011101110110" + "000011001001010100010" + "000000100001011010010" + "111010000100111010011" + "111110100011001111101" + "000000001000000010000" + "111111101011100011010" + "100000100010010100001" + "101110100010111001011" + "101110101000011100010" + "101110100011001010101" + "100000101011100111011" + "111111101110000011110" + }, + /* 88*/ { BARCODE_QRCODE, UNICODE_MODE, 35, 1, -1, -1, { 0, 0, "" }, "バーコード", -1, 0, 25, 25, 1, "AIM ITS/04-023:2022 ECI 35 Example 2", + "1111111000100110101111111" + "1000001001000111001000001" + "1011101010010110101011101" + "1011101001001101001011101" + "1011101001001000101011101" + "1000001000111001001000001" + "1111111010101010101111111" + "0000000010010111000000000" + "1110111110001010111000100" + "0111100101011101010101010" + "1111111010111010000011001" + "1100110101101100001101000" + "1111001010110010101010110" + "0101100100110101101101010" + "1001011110000011001010111" + "0101010100010100101101000" + "1010001101101011111110101" + "0000000011111101100011010" + "1111111011011010101010111" + "1000001011001101100011001" + "1011101011010010111110101" + "1011101001010001010100111" + "1011101011100100101011001" + "1000001010110001010010101" + "1111111011001000101010111" + }, + /* 89*/ { BARCODE_QRCODE, UNICODE_MODE, 35, 1, -1, -1, { 0, 0, "" }, "바코드", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 35 Example 3; BWIPP uses mask 011 instead of 111", + "111111100010101111111" + "100000101010101000001" + "101110101011001011101" + "101110100000101011101" + "101110101110101011101" + "100000101110001000001" + "111111101010101111111" + "000000001001000000000" + "110100110011101110110" + "011011011001010011010" + "100001110010111111100" + "001111010100011101011" + "111011100110101100101" + "000000001101000111100" + "111111101111100110010" + "100000100001010000101" + "101110100110111100111" + "101110101100000100010" + "101110100111111010101" + "100000101000111111011" + "111111101101000011110" + }, + /* 90*/ { BARCODE_QRCODE, UNICODE_MODE, 170, 1, -1, -1, { 0, 0, "" }, "sn:7QPB4MN", -1, 0, 21, 21, 0, "AIM ITS/04-023:2022 ECI 170 Example 1 **NOT SAME** different encodation; BWIPP same encodation as example but uses mask 011 instead of 111", + "111111101100101111111" + "100000100100101000001" + "101110101010101011101" + "101110101001001011101" + "101110101110001011101" + "100000100000001000001" + "111111101010101111111" + "000000000110000000000" + "111100101010010011101" + "100111011110101010100" + "001010111010111001011" + "010110010100100010011" + "111011100011010010001" + "000000001011011110000" + "111111100100011111111" + "100000100010110100100" + "101110100101110100101" + "101110101100101011010" + "101110101100000100001" + "100000101000110010110" + "111111101011100010100" + }, + /* 91*/ { BARCODE_QRCODE, DATA_MODE, 899, 1, -1, -1, { 0, 0, "" }, "\000\001\002\133\134\135\375\376\377", 9, 0, 21, 21, 1, "AIM ITS/04-023:2022 ECI 899 Example 1", + "111111101111101111111" + "100000101101101000001" + "101110100111001011101" + "101110100101101011101" + "101110101000101011101" + "100000101010001000001" + "111111101010101111111" + "000000001111000000000" + "111001101111111110011" + "101010000100010000000" + "110000111010001001101" + "001100010100111100111" + "010100101010001010111" + "000000001000011110000" + "111111100011100101110" + "100000101000011100011" + "101110100011101011111" + "101110100101111010000" + "101110101100000111110" + "100000101111111000011" + "111111101000010110101" + }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -1523,7 +3041,9 @@ static void test_qr_encode(int index, int generate, int debug) { symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, data[i].data, -1, debug); + 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, -1 /*output_options*/, + data[i].data, data[i].length, debug); if (data[i].structapp.count) { symbol->structapp = data[i].structapp; } @@ -1532,11 +3052,11 @@ static void test_qr_encode(int index, int generate, int debug) { assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); if (generate) { - printf(" /*%3d*/ { %s, %s, %d, %d, %s, { %d, %d, \"%s\" }, \"%s\", %s, %d, %d, %d, \"%s\",\n", + printf(" /*%3d*/ { %s, %s, %d, %d, %d, %s, { %d, %d, \"%s\" }, \"%s\", %d, %s, %d, %d, %d, \"%s\",\n", i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), - data[i].option_1, data[i].option_2, testUtilOption3Name(data[i].option_3), + data[i].eci, data[i].option_1, data[i].option_2, testUtilOption3Name(data[i].option_3), data[i].structapp.index, data[i].structapp.count, data[i].structapp.id, - testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), testUtilErrorName(data[i].ret), + testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), data[i].length, testUtilErrorName(data[i].ret), symbol->rows, symbol->width, data[i].bwipp_cmp, data[i].comment); testUtilModulesPrint(symbol, " ", "\n"); printf(" },\n"); @@ -1561,11 +3081,11 @@ static void test_qr_encode(int index, int generate, int debug) { i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[32768]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -2677,9 +4197,9 @@ static void test_rmqr_options(int index, int debug) { /* 13*/ { "\177\177\177\177\177", 4, 11, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, /* 14*/ { "\177\177\177\177\177\177", 2, 11, 0, 0, 11, 27 }, // Max capacity ECC M, version 11, 6 bytes /* 15*/ { "\177\177\177\177\177\177\177", 2, 11, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 16*/ { "点茗", 4, 11, 0, 0, 11, 27 }, // Max capacity ECC H, version 11, 2 kanji + /* 16*/ { "点茗", 4, 11, ZINT_WARN_NONCOMPLIANT, 0, 11, 27 }, // Max capacity ECC H, version 11, 2 kanji /* 17*/ { "点茗点", 4, 11, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 18*/ { "点茗点", 2, 11, 0, 0, 11, 27 }, // Max capacity ECC M, version 11, 3 kanji + /* 18*/ { "点茗点", 2, 11, ZINT_WARN_NONCOMPLIANT, 0, 11, 27 }, // Max capacity ECC M, version 11, 3 kanji /* 19*/ { "点茗点茗", 2, 11, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, /* 20*/ { "12345", -1, 1, 0, 0, 7, 43 }, // ECC auto-set to M, version 1 (R7x43) /* 21*/ { "12345", 2, 1, 0, 0, 7, 43 }, @@ -2695,41 +4215,41 @@ static void test_rmqr_options(int index, int debug) { /* 31*/ { "\177\177\177", 4, 1, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, /* 32*/ { "\177\177\177\177\177", 2, 1, 0, 0, 7, 43 }, // Max capacity ECC M, version 1, 5 bytes /* 33*/ { "\177\177\177\177\177\177", 2, 1, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 34*/ { "点", 4, 1, 0, 0, 7, 43 }, // Max capacity ECC H, version 1, 1 kanji + /* 34*/ { "点", 4, 1, ZINT_WARN_NONCOMPLIANT, 0, 7, 43 }, // Max capacity ECC H, version 1, 1 kanji /* 35*/ { "点茗", 4, 1, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 36*/ { "点茗点", 2, 1, 0, 0, 7, 43 }, // Max capacity ECC M, version 1, 3 kanji + /* 36*/ { "点茗点", 2, 1, ZINT_WARN_NONCOMPLIANT, 0, 7, 43 }, // Max capacity ECC M, version 1, 3 kanji /* 37*/ { "点茗点茗", 2, 1, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, /* 38*/ { "12345678901234567890123", 4, 7, 0, 0, 9, 59 }, // Max capacity ECC H, version 7 (R9x59), 23 numbers /* 39*/ { "123456789012345678901234", 4, 7, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 40*/ { "点茗点茗点茗", 4, 7, 0, 0, 9, 59 }, // Max capacity ECC H, version 7, 6 kanji + /* 40*/ { "点茗点茗点茗", 4, 7, ZINT_WARN_NONCOMPLIANT, 0, 9, 59 }, // Max capacity ECC H, version 7, 6 kanji /* 41*/ { "点茗点茗点茗点", 4, 7, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 42*/ { "点茗点茗点茗点茗", 4, 13, 0, 0, 11, 59 }, // Max capacity ECC H, version 13 (R11x59), 8 kanji + /* 42*/ { "点茗点茗点茗点茗", 4, 13, ZINT_WARN_NONCOMPLIANT, 0, 11, 59 }, // Max capacity ECC H, version 13 (R11x59), 8 kanji /* 43*/ { "点茗点茗点茗点茗点", 4, 13, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 44*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点", 4, 20, 0, 0, 13, 77 }, // Max capacity ECC H, version 20 (R13x77), 17 kanji + /* 44*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点", 4, 20, ZINT_WARN_NONCOMPLIANT, 0, 13, 77 }, // Max capacity ECC H, version 20 (R13x77), 17 kanji /* 45*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗", 4, 20, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 46*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点点茗点茗点茗点点茗点茗", 4, 26, 0, 0, 15, 99 }, // Max capacity ECC H, version 26 (R15x99), 28 kanji + /* 46*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点点茗点茗点茗点点茗点茗", 4, 26, ZINT_WARN_NONCOMPLIANT, 0, 15, 99 }, // Max capacity ECC H, version 26 (R15x99), 28 kanji /* 47*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点", 4, 26, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 48*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗", 4, 32, 0, 0, 17, 139 }, // Max capacity ECC H, version 32 (R17x139), 46 kanji + /* 48*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗", 4, 32, ZINT_WARN_NONCOMPLIANT, 0, 17, 139 }, // Max capacity ECC H, version 32 (R17x139), 46 kanji /* 49*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点", 4, 32, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 50*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗", -1, 32, 0, 0, 17, 139 }, // Max capacity ECC M, version 32, 92 kanji + /* 50*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗", -1, 32, ZINT_WARN_NONCOMPLIANT, 0, 17, 139 }, // Max capacity ECC M, version 32, 92 kanji /* 51*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点", 4, 32, ZINT_ERROR_TOO_LONG, -1, 0, 0 }, - /* 52*/ { "点茗点", -1, 33, 0, 0, 7, 43 }, // ECC auto-set to M, version 33 (R7xAuto-width) auto-sets R7x43 - /* 53*/ { "点茗点", 4, 33, 0, 0, 7, 59 }, // ECC set to H, version 33 (R7xAuto-width) auto-sets R7x59 - /* 54*/ { "点茗点", -1, 34, 0, 0, 9, 43 }, // ECC auto-set to H, version 34 (R9xAuto-width) auto-sets R9x43 - /* 55*/ { "点茗点", -1, 35, 0, 0, 11, 27 }, // ECC auto-set to M, version 35 (R11xAuto-width) auto-sets R11x27 - /* 56*/ { "点茗点茗点茗点", 4, 35, 0, 0, 11, 59 }, // ECC set to H, version 35 (R11xAuto-width) auto-sets R11x59 - /* 57*/ { "点茗点茗点茗点", -1, 35, 0, 0, 11, 43 }, // ECC auto-set to M, version 35 (R11xAuto-width) auto-sets R11x43 - /* 58*/ { "点茗点茗点茗点茗", -1, 36, 0, 0, 13, 43 }, // ECC auto-set to M, version 36 (R13xAuto-width) auto-sets R13x43 - /* 59*/ { "点茗点茗点茗点茗", 4, 36, 0, 0, 13, 59 }, // ECC set to H, version 36 (R13xAuto-width) auto-sets R13x59 - /* 60*/ { "点茗点茗点茗点茗点", -1, 37, 0, 0, 15, 43 }, // ECC auto-set to M, version 37 (R15xAuto-width) auto-sets R15x43 - /* 61*/ { "点茗点茗点茗点茗点", 4, 37, 0, 0, 15, 59 }, // ECC set to H, version 37 (R15xAuto-width) auto-sets R15x59 - /* 62*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗", -1, 38, 0, 0, 17, 43 }, // ECC auto-set to M, version 38 (R17xAuto-width) auto-sets R17x43 - /* 63*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗", 4, 38, 0, 0, 17, 77 }, // ECC set to H, version 38 (R17xAuto-width) auto-sets R17x77 + /* 52*/ { "点茗点", -1, 33, ZINT_WARN_NONCOMPLIANT, 0, 7, 43 }, // ECC auto-set to M, version 33 (R7xAuto-width) auto-sets R7x43 + /* 53*/ { "点茗点", 4, 33, ZINT_WARN_NONCOMPLIANT, 0, 7, 59 }, // ECC set to H, version 33 (R7xAuto-width) auto-sets R7x59 + /* 54*/ { "点茗点", -1, 34, ZINT_WARN_NONCOMPLIANT, 0, 9, 43 }, // ECC auto-set to H, version 34 (R9xAuto-width) auto-sets R9x43 + /* 55*/ { "点茗点", -1, 35, ZINT_WARN_NONCOMPLIANT, 0, 11, 27 }, // ECC auto-set to M, version 35 (R11xAuto-width) auto-sets R11x27 + /* 56*/ { "点茗点茗点茗点", 4, 35, ZINT_WARN_NONCOMPLIANT, 0, 11, 59 }, // ECC set to H, version 35 (R11xAuto-width) auto-sets R11x59 + /* 57*/ { "点茗点茗点茗点", -1, 35, ZINT_WARN_NONCOMPLIANT, 0, 11, 43 }, // ECC auto-set to M, version 35 (R11xAuto-width) auto-sets R11x43 + /* 58*/ { "点茗点茗点茗点茗", -1, 36, ZINT_WARN_NONCOMPLIANT, 0, 13, 43 }, // ECC auto-set to M, version 36 (R13xAuto-width) auto-sets R13x43 + /* 59*/ { "点茗点茗点茗点茗", 4, 36, ZINT_WARN_NONCOMPLIANT, 0, 13, 59 }, // ECC set to H, version 36 (R13xAuto-width) auto-sets R13x59 + /* 60*/ { "点茗点茗点茗点茗点", -1, 37, ZINT_WARN_NONCOMPLIANT, 0, 15, 43 }, // ECC auto-set to M, version 37 (R15xAuto-width) auto-sets R15x43 + /* 61*/ { "点茗点茗点茗点茗点", 4, 37, ZINT_WARN_NONCOMPLIANT, 0, 15, 59 }, // ECC set to H, version 37 (R15xAuto-width) auto-sets R15x59 + /* 62*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗", -1, 38, ZINT_WARN_NONCOMPLIANT, 0, 17, 43 }, // ECC auto-set to M, version 38 (R17xAuto-width) auto-sets R17x43 + /* 63*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗", 4, 38, ZINT_WARN_NONCOMPLIANT, 0, 17, 77 }, // ECC set to H, version 38 (R17xAuto-width) auto-sets R17x77 /* 64*/ { "点茗点", -1, 39, ZINT_ERROR_INVALID_OPTION, -1, 0, 0 }, - /* 65*/ { "点茗点", 4, -1, 0, 0, 13, 27 }, // ECC set to H, auto-sets R13x27 - /* 66*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗", 4, -1, 0, 0, 15, 99 }, // ECC set to H, auto-sets R15x99 (max capacity) - /* 67*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点", 4, -1, 0, 0, 17, 99 }, // ECC set to H, auto-sets R17x99 - /* 68*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗", 4, -1, 0, 0, 17, 139 }, // ECC set to H, auto-sets R17x139 (max capacity) + /* 65*/ { "点茗点", 4, -1, ZINT_WARN_NONCOMPLIANT, 0, 13, 27 }, // ECC set to H, auto-sets R13x27 + /* 66*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗", 4, -1, ZINT_WARN_NONCOMPLIANT, 0, 15, 99 }, // ECC set to H, auto-sets R15x99 (max capacity) + /* 67*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点", 4, -1, ZINT_WARN_NONCOMPLIANT, 0, 17, 99 }, // ECC set to H, auto-sets R17x99 + /* 68*/ { "点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗点茗", 4, -1, ZINT_WARN_NONCOMPLIANT, 0, 17, 139 }, // ECC set to H, auto-sets R17x139 (max capacity) }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -2783,7 +4303,7 @@ static void test_rmqr_input(int index, int generate, int debug) { /* 3*/ { UNICODE_MODE, 26, -1, "é", 0, 26, "71 A6 B0 EA 40", "ECI-26 B2 (UTF-8)" }, /* 4*/ { DATA_MODE, 0, -1, "é", 0, 0, "6B 0E A4 00 EC", "B2 (UTF-8)" }, /* 5*/ { DATA_MODE, 0, -1, "\351", 0, 0, "67 A4 00 EC 11", "B1 (ISO 8859-1)" }, - /* 6*/ { UNICODE_MODE, 0, -1, "β", 0, 0, "88 80 00 EC 11", "K1 (Shift JIS)" }, + /* 6*/ { UNICODE_MODE, 0, -1, "β", ZINT_WARN_NONCOMPLIANT, 0, "Warning 88 80 00 EC 11", "K1 (Shift JIS)" }, /* 7*/ { UNICODE_MODE, 9, -1, "β", 0, 9, "70 96 78 80 EC", "ECI-9 B1 (ISO 8859-7)" }, /* 8*/ { UNICODE_MODE, 20, -1, "β", 0, 20, "71 48 88 00 00", "ECI-20 K1 (Shift JIS)" }, /* 9*/ { UNICODE_MODE, 26, -1, "β", 0, 26, "71 A6 B3 AC 80", "ECI-26 B2 (UTF-8)" }, @@ -2793,7 +4313,7 @@ static void test_rmqr_input(int index, int generate, int debug) { /* 13*/ { UNICODE_MODE, 20, -1, "ก", ZINT_ERROR_INVALID_DATA, -1, "Error 800: Invalid character in input data", "ก not in Shift JIS" }, /* 14*/ { UNICODE_MODE, 26, -1, "ก", 0, 26, "71 A6 F8 2E 20 40 EC", "ECI-26 B3 (UTF-8)" }, /* 15*/ { DATA_MODE, 0, -1, "ก", 0, 0, "6F 82 E2 04 00", "B3 (UTF-8)" }, - /* 16*/ { UNICODE_MODE, 0, -1, "Ж", 0, 0, "88 91 C0 EC 11", "K1 (Shift JIS)" }, + /* 16*/ { UNICODE_MODE, 0, -1, "Ж", ZINT_WARN_NONCOMPLIANT, 0, "Warning 88 91 C0 EC 11", "K1 (Shift JIS)" }, /* 17*/ { UNICODE_MODE, 7, -1, "Ж", 0, 7, "70 76 6D 80 EC", "ECI-7 B1 (ISO 8859-5)" }, /* 18*/ { UNICODE_MODE, 20, -1, "Ж", 0, 20, "71 48 89 1C 00", "ECI-20 K1 (Shift JIS)" }, /* 19*/ { UNICODE_MODE, 26, -1, "Ж", 0, 26, "71 A6 B4 25 80", "ECI-26 B2 (UTF-8)" }, @@ -2811,7 +4331,7 @@ static void test_rmqr_input(int index, int generate, int debug) { /* 31*/ { UNICODE_MODE, 20, -1, "¥", 0, 20, "71 46 57 00 EC", "ECI-20 B1 (Shift JIS) (to single-byte backslash codepoint 5C, so byte mode)" }, /* 32*/ { UNICODE_MODE, 26, -1, "¥", 0, 26, "71 A6 B0 A9 40", "ECI-26 B2 (UTF-8)" }, /* 33*/ { DATA_MODE, 0, -1, "¥", 0, 0, "6B 0A 94 00 EC", "B2 (UTF-8)" }, - /* 34*/ { UNICODE_MODE, 0, -1, "・", 0, 0, "66 94 00 EC 11", "B1 (Shift JIS) single-byte codepoint A5 (same bytes as ¥ ISO 8859-1 above, so ambiguous)" }, + /* 34*/ { UNICODE_MODE, 0, -1, "・", ZINT_WARN_NONCOMPLIANT, 0, "Warning 66 94 00 EC 11", "B1 (Shift JIS) single-byte codepoint A5 (same bytes as ¥ ISO 8859-1 above, so ambiguous)" }, /* 35*/ { UNICODE_MODE, 3, -1, "・", ZINT_ERROR_INVALID_DATA, -1, "Error 564: Invalid character in input data for ECI 3", "" }, /* 36*/ { UNICODE_MODE, 20, -1, "・", 0, 20, "71 46 69 40 EC", "ECI-20 B1 (Shift JIS) single-byte codepoint A5" }, /* 37*/ { UNICODE_MODE, 26, -1, "・", 0, 26, "71 A6 FB EF 69 40 EC", "ECI-26 B3 (UTF-8)" }, @@ -2821,7 +4341,7 @@ static void test_rmqr_input(int index, int generate, int debug) { /* 41*/ { UNICODE_MODE, 20, -1, "¿", ZINT_ERROR_INVALID_DATA, -1, "Error 800: Invalid character in input data", "¿ not in Shift JIS" }, /* 42*/ { UNICODE_MODE, 26, -1, "¿", 0, 26, "71 A6 B0 AF C0", "ECI-26 B2 (UTF-8)" }, /* 43*/ { DATA_MODE, 0, -1, "¿", 0, 0, "6B 0A FC 00 EC", "B2 (UTF-8)" }, - /* 44*/ { UNICODE_MODE, 0, -1, "ソ", 0, 0, "66 FC 00 EC 11", "B1 (Shift JIS) single-byte codepoint BF (same bytes as ¿ ISO 8859-1 above, so ambiguous)" }, + /* 44*/ { UNICODE_MODE, 0, -1, "ソ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 66 FC 00 EC 11", "B1 (Shift JIS) single-byte codepoint BF (same bytes as ¿ ISO 8859-1 above, so ambiguous)" }, /* 45*/ { UNICODE_MODE, 3, -1, "ソ", ZINT_ERROR_INVALID_DATA, -1, "Error 564: Invalid character in input data for ECI 3", "" }, /* 46*/ { UNICODE_MODE, 20, -1, "ソ", 0, 20, "71 46 6F C0 EC", "ECI-20 B1 (Shift JIS) single-byte codepoint BF" }, /* 47*/ { UNICODE_MODE, 26, -1, "ソ", 0, 26, "71 A6 FB EF 6F C0 EC", "ECI-26 B3 (UTF-8)" }, @@ -2829,26 +4349,26 @@ static void test_rmqr_input(int index, int generate, int debug) { /* 49*/ { UNICODE_MODE, 0, -1, "~", 0, 0, "65 F8 00 EC 11", "B1 (ASCII) (same bytes as ‾ Shift JIS below, so ambiguous)" }, /* 50*/ { UNICODE_MODE, 3, -1, "~", 0, 3, "70 36 5F 80 EC", "ECI-3 B1 (ASCII)" }, /* 51*/ { UNICODE_MODE, 20, -1, "~", ZINT_ERROR_INVALID_DATA, -1, "Error 800: Invalid character in input data", "tilde not in Shift JIS (codepoint used for overline)" }, - /* 52*/ { UNICODE_MODE, 0, -1, "‾", 0, 0, "65 F8 00 EC 11", "B1 (Shift JIS) single-byte codepoint 7E (same bytes as ~ ASCII above, so ambiguous)" }, + /* 52*/ { UNICODE_MODE, 0, -1, "‾", ZINT_WARN_NONCOMPLIANT, 0, "Warning 65 F8 00 EC 11", "B1 (Shift JIS) single-byte codepoint 7E (same bytes as ~ ASCII above, so ambiguous)" }, /* 53*/ { UNICODE_MODE, 3, -1, "‾", ZINT_ERROR_INVALID_DATA, -1, "Error 564: Invalid character in input data for ECI 3", "" }, /* 54*/ { UNICODE_MODE, 20, -1, "‾", 0, 20, "71 46 5F 80 EC", "ECI-20 B1 (Shift JIS) (to single-byte tilde codepoint 7E, so byte mode)" }, /* 55*/ { UNICODE_MODE, 26, -1, "‾", 0, 26, "71 A6 F8 A0 2F 80 EC", "ECI-26 B3 (UTF-8)" }, /* 56*/ { DATA_MODE, 0, -1, "‾", 0, 0, "6F 8A 02 F8 00", "B3 (UTF-8)" }, - /* 57*/ { UNICODE_MODE, 0, -1, "点", 0, 0, "8B 67 C0 EC 11", "K1 (Shift JIS)" }, + /* 57*/ { UNICODE_MODE, 0, -1, "点", ZINT_WARN_NONCOMPLIANT, 0, "Warning 8B 67 C0 EC 11", "K1 (Shift JIS)" }, /* 58*/ { UNICODE_MODE, 3, -1, "点", ZINT_ERROR_INVALID_DATA, -1, "Error 564: Invalid character in input data for ECI 3", "" }, /* 59*/ { UNICODE_MODE, 20, -1, "点", 0, 20, "71 48 B6 7C 00", "ECI-20 K1 (Shift JIS)" }, /* 60*/ { UNICODE_MODE, 26, -1, "点", 0, 26, "71 A6 F9 E0 AE 40 EC", "ECI-26 B3 (UTF-8)" }, /* 61*/ { DATA_MODE, 0, -1, "点", 0, 0, "6F 9E 0A E4 00", "B3 (UTF-8)" }, /* 62*/ { DATA_MODE, 0, -1, "\223\137", 0, 0, "6A 4D 7C 00 EC", "B2 (Shift JIS) (not full multibyte)" }, /* 63*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "\223\137", 0, 0, "8B 67 C0 EC 11", "K1 (Shift JIS)" }, - /* 64*/ { UNICODE_MODE, 0, -1, "¥・点", 0, 0, "71 72 96 4D 7C", "B4 (Shift JIS) (optimized to byte mode only)" }, + /* 64*/ { UNICODE_MODE, 0, -1, "¥・点", ZINT_WARN_NONCOMPLIANT, 0, "Warning 71 72 96 4D 7C", "B4 (Shift JIS) (optimized to byte mode only)" }, /* 65*/ { UNICODE_MODE, 3, -1, "¥・点", ZINT_ERROR_INVALID_DATA, -1, "Error 564: Invalid character in input data for ECI 3", "" }, /* 66*/ { UNICODE_MODE, 20, -1, "¥・点", 0, 20, "71 47 17 29 64 D7 C0", "ECI-20 B4 (Shift JIS)" }, /* 67*/ { UNICODE_MODE, 26, -1, "¥・点", 0, 26, "71 A7 18 54 BD F7 B4 BC F0 57 20 EC", "ECI-26 B8 (UTF-8)" }, /* 68*/ { DATA_MODE, 0, -1, "\134\245\223\137", 0, 0, "71 72 96 4D 7C", "B8 (Shift JIS)" }, /* 69*/ { DATA_MODE, 0, -1, "¥・点", 0, 0, "71 85 4B DF 7B 4B CF 05 72 00 EC 11", "B8 (UTF-8)" }, - /* 70*/ { UNICODE_MODE, 0, -1, "点茗", 0, 0, "93 67 F5 54 00", "K2 (Shift JIS)" }, - /* 71*/ { UNICODE_MODE, 0, -1, "点茗テ点茗テソ", 0, 0, "8C D9 FD 55 06 95 B3 FA AA 0D 2B 0D F8 EC 11 EC 11 EC 11", "K6 B1 (Shift JIS)" }, + /* 70*/ { UNICODE_MODE, 0, -1, "点茗", ZINT_WARN_NONCOMPLIANT, 0, "Warning 93 67 F5 54 00", "K2 (Shift JIS)" }, + /* 71*/ { UNICODE_MODE, 0, -1, "点茗テ点茗テソ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 8C D9 FD 55 06 95 B3 FA AA 0D 2B 0D F8 EC 11 EC 11 EC 11", "K6 B1 (Shift JIS)" }, /* 72*/ { DATA_MODE, 0, -1, "\223\137\344\252\203\145\223\137\344\252\203\145\277", 0, 0, "6D 93 5F E4 AA 83 65 93 5F E4 AA 83 65 BF 00 EC 11 EC 11", "B13 (Shift JIS)" }, /* 73*/ { DATA_MODE, 0, ZINT_FULL_MULTIBYTE, "\223\137\344\252\203\145\223\137\344\252\203\145\277", 0, 0, "8C D9 FD 55 06 95 B3 FA AA 0D 2B 0D F8 EC 11 EC 11 EC 11", "K6 B1 (Shift JIS) (full multibyte)" }, /* 74*/ { UNICODE_MODE, 0, -1, "áA", 0, 0, "6B 85 04 00 EC", "B2 (ISO 8859-1)" }, @@ -2862,11 +4382,11 @@ static void test_rmqr_input(int index, int generate, int debug) { /* 82*/ { UNICODE_MODE, 6, -1, "ĸ", 0, 6, "70 66 68 80 EC", "ECI-6 B1 (ISO 8859-4)" }, /* 83*/ { UNICODE_MODE, 0, -1, "Ș", ZINT_WARN_USES_ECI, 18, "Warning 71 26 6A 80 EC", "ECI-18 B1 (ISO 8859-16)" }, /* 84*/ { UNICODE_MODE, 18, -1, "Ș", 0, 18, "71 26 6A 80 EC", "ECI-18 B1 (ISO 8859-16)" }, - /* 85*/ { UNICODE_MODE, 0, -1, "テ", 0, 0, "88 69 40 EC 11", "K1 (SHIFT JIS)" }, + /* 85*/ { UNICODE_MODE, 0, -1, "テ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 88 69 40 EC 11", "K1 (SHIFT JIS)" }, /* 86*/ { UNICODE_MODE, 20, -1, "テ", 0, 20, "71 48 86 94 00", "ECI-20 K1 (SHIFT JIS)" }, /* 87*/ { UNICODE_MODE, 20, -1, "テテ", 0, 20, "71 49 06 94 34 A0 EC", "ECI-20 K2 (SHIFT JIS)" }, /* 88*/ { UNICODE_MODE, 20, -1, "\\\\", 0, 20, "71 49 00 7C 03 E0 EC", "ECI-20 K2 (SHIFT JIS)" }, - /* 89*/ { UNICODE_MODE, 0, -1, "…", 0, 0, "88 08 C0 EC 11", "K1 (SHIFT JIS)" }, + /* 89*/ { UNICODE_MODE, 0, -1, "…", ZINT_WARN_NONCOMPLIANT, 0, "Warning 88 08 C0 EC 11", "K1 (SHIFT JIS)" }, /* 90*/ { UNICODE_MODE, 21, -1, "…", 0, 21, "71 56 61 40 EC", "ECI-21 B1 (Win 1250)" }, /* 91*/ { UNICODE_MODE, 0, -1, "Ґ", ZINT_WARN_USES_ECI, 22, "Warning 71 66 69 40 EC", "ECI-22 B1 (Win 1251)" }, /* 92*/ { UNICODE_MODE, 22, -1, "Ґ", 0, 22, "71 66 69 40 EC", "ECI-22 B1 (Win 1251)" }, @@ -3007,7 +4527,7 @@ static void test_rmqr_optimize(int index, int generate, int debug) { /* 2*/ { UNICODE_MODE, "0123456789", -1, 0, "34 06 2B 35 34 80 EC", "N10 (nayuki.io - pure numeric)" }, /* 3*/ { UNICODE_MODE, "ABCDEF", -1, 0, "4C 73 51 4A 85 00 EC", "A6 (nayuki.io - pure alphanumeric)" }, /* 4*/ { UNICODE_MODE, "wxyz", -1, 0, "71 DD E1 E5 E8", "B4 (nayuki.io - pure byte)" }, - /* 5*/ { UNICODE_MODE, "「魔法少女まどか☆マギカ」って、 ИАИ desu κα?", -1, 0, "(53) 8E 80 D6 00 4F C0 57 6A B5 C2 B8 14 70 94 81 64 37 A1 8D 0C 50 0D 82 82 14 40 00 80", "K29 (nayuki.io - pure kanji)" }, + /* 5*/ { UNICODE_MODE, "「魔法少女まどか☆マギカ」って、 ИАИ desu κα?", -1, ZINT_WARN_NONCOMPLIANT, "Warning (53) 8E 80 D6 00 4F C0 57 6A B5 C2 B8 14 70 94 81 64 37 A1 8D 0C 50 0D 82 82 14 40 00 80", "K29 (nayuki.io - pure kanji)" }, /* 6*/ { UNICODE_MODE, "012A", -1, 0, "48 00 43 20 EC", "A4" }, /* 7*/ { UNICODE_MODE, "0123A", -1, 0, "28 06 1A 12 80", "N4 A1 (nayuki.io - alpha/numeric)" }, /* 8*/ { UNICODE_MODE, "0a", -1, 0, "68 C1 84 00 EC", "B2 (nayuki.io - numeric/byte)" }, @@ -3015,15 +4535,15 @@ static void test_rmqr_optimize(int index, int generate, int debug) { /* 10*/ { UNICODE_MODE, "ABCa", -1, 0, "71 05 09 0D 84", "B4 (nayuki.io - alphanumeric/byte)" }, /* 11*/ { UNICODE_MODE, "ABCDa", -1, 0, "48 73 51 4B 2C 20 EC", "A4 B1 (same bits as B5)" }, /* 12*/ { UNICODE_MODE, "THE SQUARE ROOT OF 2 IS 1.41421356237309504880168872420969807856967187537694807317667973799", -1, 0, "(48) 46 A9 52 9A A0 D5 42 66 E6 F8 A1 4F 62 3E 56 CC D4 40 2B 98 2C F1 AB 19 2E A2 F8 61", " A26 N65 (nayuki.io - alpha/numeric)" }, - /* 13*/ { UNICODE_MODE, "Golden ratio φ = 1.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374......", -1, 0, "(73) 65 11 DB DB 19 19 5B 88 1C 98 5D 1A 5B C8 20 F4 C8 0F 48 0C 4B 8B 24 D4 10 FB 97 6E", "B20 N100 A6 (nayuki.io - alpha/numeric/byte)" }, - /* 14*/ { UNICODE_MODE, "こんにちwa、世界! αβγδ", -1, 0, "84 09 88 5C 42 92 13 F6 B7 76 18 14 19 0A 28 A4 58 14 92 08 40 FF 88 00 40 22 02", "K4 B7 K4 (nayuki.io - kanji/european)" }, + /* 13*/ { UNICODE_MODE, "Golden ratio φ = 1.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374......", -1, ZINT_WARN_NONCOMPLIANT, "Warning (73) 65 11 DB DB 19 19 5B 88 1C 98 5D 1A 5B C8 20 F4 C8 0F 48 0C 4B 8B 24 D4 10 FB 97 6E", "B20 N100 A6 (nayuki.io - alpha/numeric/byte)" }, + /* 14*/ { UNICODE_MODE, "こんにちwa、世界! αβγδ", -1, ZINT_WARN_NONCOMPLIANT, "Warning 84 09 88 5C 42 92 13 F6 B7 76 18 14 19 0A 28 A4 58 14 92 08 40 FF 88 00 40 22 02", "K4 B7 K4 (nayuki.io - kanji/european)" }, /* 15*/ { UNICODE_MODE, "6547861663com.acme35584af52fa3-88d0-093b-6c14-b37ddafb59c528908608sg.com.dash.www05303790265903SG.COM.NETS46967004B2AE13344004SG.SGQR209710339382.6359SG8236HELLO FOO2517Singapore3272B815", -1, 0, "(152) 20 AA 3B 12 29 8D 97 B1 B7 B6 97 30 B1 B6 B2 99 9A 9A 9C 1A 30 B3 1A 99 33 30 99 96", "N10 B47 N9 B15 N14 A38 N12 A25 B8 A8 (nayuki.io - SGQR alpha/numeric/byte)" }, - /* 16*/ { UNICODE_MODE, "2004年大西洋颶風季是有以来造成人失惨重的大季之一,于2004年6月1日正式始,同年11月30日束,上的日期界定了一年中大多数气旋在大西洋形成的段lll ku", -1, 0, "(127) 20 43 21 21 87 27 32 95 77 90 AD F0 33 D5 CF 0E BA 58 46 17 22 19 0C 62 5D 62 DB 14", "N4 K24 N4 B6 K7 B6 K26 B6 (nayuki.io - kanji/byte/numeric, non-Shift JIS removed)" }, + /* 16*/ { UNICODE_MODE, "2004年大西洋颶風季是有以来造成人失惨重的大季之一,于2004年6月1日正式始,同年11月30日束,上的日期界定了一年中大多数气旋在大西洋形成的段lll ku", -1, ZINT_WARN_NONCOMPLIANT, "Warning (127) 20 43 21 21 87 27 32 95 77 90 AD F0 33 D5 CF 0E BA 58 46 17 22 19 0C 62 5D 62 DB 14", "N4 K24 N4 B6 K7 B6 K26 B6 (nayuki.io - kanji/byte/numeric, non-Shift JIS removed)" }, /* 17*/ { UNICODE_MODE, "AB1234567A", -1, 0, "4A 39 A0 BC 45 8E 72 8A 00 EC 11 EC", "A10" }, /* 18*/ { UNICODE_MODE, "AB12345678A", -1, 0, "42 39 A5 03 DB 91 39 04 A0 EC 11 EC", "A2 N8 A1" }, - /* 19*/ { UNICODE_MODE, "テaA1", -1, 0, "76 0D 95 85 04 C4 00", "B4" }, - /* 20*/ { UNICODE_MODE, "テaAB1", -1, 0, "6E 0D 95 85 19 CD 04", "B3 A3" }, - /* 21*/ { UNICODE_MODE, "貫やぐ識禁ぱい再2間変字全ノレ没無8裁花ほゃ過法ひなご札17能つーびれ投覧マ勝動エヨ額界よみ作皇ナヲニ打題ヌルヲ掲布益フが。入35能ト権話しこを断兆モヘ細情おじ名4減エヘイハ側機", -1, 0, "(152) 82 0E A2 16 20 97 28 BD 02 C1 4F 09 12 61 08 04 A0 83 AA 3E 3D 43 4C 13 0D 68 73 1F", "K8 N1 K8 N1 K10 N2 K33 N2 K16 N1 K7" }, + /* 19*/ { UNICODE_MODE, "テaA1", -1, ZINT_WARN_NONCOMPLIANT, "Warning 76 0D 95 85 04 C4 00", "B4" }, + /* 20*/ { UNICODE_MODE, "テaAB1", -1, ZINT_WARN_NONCOMPLIANT, "Warning 6E 0D 95 85 19 CD 04", "B3 A3" }, + /* 21*/ { UNICODE_MODE, "貫やぐ識禁ぱい再2間変字全ノレ没無8裁花ほゃ過法ひなご札17能つーびれ投覧マ勝動エヨ額界よみ作皇ナヲニ打題ヌルヲ掲布益フが。入35能ト権話しこを断兆モヘ細情おじ名4減エヘイハ側機", -1, ZINT_WARN_NONCOMPLIANT, "Warning (152) 82 0E A2 16 20 97 28 BD 02 C1 4F 09 12 61 08 04 A0 83 AA 3E 3D 43 4C 13 0D 68 73 1F", "K8 N1 K8 N1 K10 N2 K33 N2 K16 N1 K7" }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -3220,7 +4740,7 @@ static void test_rmqr_encode(int index, int generate, int debug) { "1000001011111011101110111110000111111010001" "1111111010101010101011101010101010101011111" }, - /* 12*/ { UNICODE_MODE, 2, 1, "点茗点", 0, 7, 43, 1, "R7x43-M with max 3 Kanji", + /* 12*/ { UNICODE_MODE, 2, 1, "点茗点", ZINT_WARN_NONCOMPLIANT, 7, 43, 1, "R7x43-M with max 3 Kanji", "1111111010101010101011101010101010101010111" "1000001001011000100010101001010001111000101" "1011101010110101110111111001011101111111111" @@ -3539,3 +5059,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et norl : */ diff --git a/backend/tests/test_rss.c b/backend/tests/test_rss.c index 05d341a6..0c78b7e1 100644 --- a/backend/tests/test_rss.c +++ b/backend/tests/test_rss.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -173,11 +172,11 @@ static void test_binary_div_modulo_divisor(int index, int generate, int debug) { assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[8192 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -913,11 +912,11 @@ static void test_examples(int index, int generate, int debug) { i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[8192 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -1510,3 +1509,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/test_upcean.c b/backend/tests/test_upcean.c index 0f49d5ee..cd7f4630 100644 --- a/backend/tests/test_upcean.c +++ b/backend/tests/test_upcean.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -129,11 +128,11 @@ static void test_upce_input(int index, int debug) { assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, modules_dump); } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[8192 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].hrt, (int) strlen(data[i].hrt), NULL /*primary*/, escaped, &ret_len); @@ -960,11 +959,11 @@ static void test_encode(int index, int generate, int debug) { assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected); } - if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, debug)) { + if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) { int cmp_len, ret_len; char modules_dump[8192 + 1]; assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i); - ret = testUtilZXingCPP(i, symbol, data[i].data, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); + ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len); assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len); @@ -1156,3 +1155,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/testcommon.c b/backend/tests/testcommon.c index a35de9c6..16e808b2 100644 --- a/backend/tests/testcommon.c +++ b/backend/tests/testcommon.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ /* * Adapted from qrencode/tests/common.c * Copyright (C) 2006-2017 Kentaro Fukuchi @@ -1608,8 +1607,8 @@ int testUtilCmpEpss(const char *eps1, const char *eps2) { char buf1[1024]; char buf2[1024]; size_t len1 = 0, len2 = 0; - char first_line[] = "%!PS-Adobe-3.0 EPSF-3.0\n"; - char second_line_start[] = "%%Creator: Zint "; + static char first_line[] = "%!PS-Adobe-3.0 EPSF-3.0\n"; + static char second_line_start[] = "%%Creator: Zint "; fp1 = fopen(eps1, "r"); if (!fp1) { @@ -2170,7 +2169,7 @@ static char *testUtilBwippEscape(char *bwipp_data, int bwipp_data_size, const ch while (b < be && d < 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 == '^' || *d == '"' || *d == '\'') { + if (*d < 0x20 || *d >= 0x7F || *d == '^' || *d == '"' || *d == '\'' || (!zint_escape_mode && *d == '\\')) { if (b + 4 >= be) { fprintf(stderr, "testUtilBwippEscape: double quote bwipp_data buffer full (%d)\n", bwipp_data_size); return NULL; @@ -2244,14 +2243,15 @@ static void testUtilISBNHyphenate(char *bwipp_data, int addon_posn) { /* 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) { - const char *cmd_fmt = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%s' backend/tests/tools/bwipp_dump.ps"; - const char *cmd_opts_fmt = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%s' -so='%s'" - " backend/tests/tools/bwipp_dump.ps"; + 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'" + " backend/tests/tools/bwipp_dump.ps"; // If data > 2K - const char *cmd_fmt2 = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%.2043s' -sd2='%s'" - " backend/tests/tools/bwipp_dump.ps"; - const char *cmd_opts_fmt2 = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%.2043s' -sd2='%s' -so='%s'" - " backend/tests/tools/bwipp_dump.ps"; + static const char cmd_fmt2[] = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%.2043s' -sd2='%s'" + " backend/tests/tools/bwipp_dump.ps"; + static const char cmd_opts_fmt2[] = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%.2043s' -sd2='%s' -so='%s'" + " backend/tests/tools/bwipp_dump.ps"; int symbology = symbol->symbology; int data_len = length == -1 ? (int) strlen(data) : length; @@ -3052,7 +3052,7 @@ int testUtilHaveZXingCPPDecoder(void) { /* Map Zint symbology to ZXing-C++ format name */ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *symbol, const char *source, - const int debug) { + const int length, const int debug) { struct item { const char *name; int define; @@ -3175,7 +3175,7 @@ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *sym { "", -1, 113, }, { "", -1, 114, }, { "DotCode", BARCODE_DOTCODE, 115, }, - { "", BARCODE_HANXIN, 116, }, + { "HanXin", BARCODE_HANXIN, 116, }, { "", -1, 117, }, { "", -1, 118, }, { "", -1, 119, }, @@ -3236,7 +3236,6 @@ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *sym } } else if (is_extendable(symbology)) { if (symbology == BARCODE_EANX || symbology == BARCODE_EANX_CHK) { - const int length = (int) strlen(source); if (length < 9) { if (length < 6) { printf("i:%d %s not ZXing-C++ compatible, EAN-5/EAN-2 not supported\n", @@ -3255,32 +3254,47 @@ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *sym } /* Whether can use ZXing-C++ to check a symbology with given options */ -int testUtilCanZXingCPP(int index, const struct zint_symbol *symbol, const char *source, const int debug) { - return testUtilZXingCPPName(index, symbol, source, debug) != NULL; +int testUtilCanZXingCPP(int index, const struct zint_symbol *symbol, const char *source, const int length, + const int debug) { + return testUtilZXingCPPName(index, symbol, source, length, debug) != NULL; } -int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, char *bits, char *buffer, - const int buffer_size, int *p_cmp_len) { - const char *cmd_fmt = "zxingcppdecoder -width %d -textonly -format %s -zint '%d,%d' -bits '%s'"; +int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, const int length, char *bits, + char *buffer, const int buffer_size, int *p_cmp_len) { + static const char cmd_fmt[] = "zxingcppdecoder -width %d -textonly -format %s -zint '%d,%d' -bits '%s'"; + static const char cs_cmd_fmt[] = "zxingcppdecoder -width %d -textonly -format %s -zint '%d,%d' -bits '%s'" + " -charset %s"; - const int length = (int) strlen(bits); + const int bits_len = (int) strlen(bits); const int width = symbol->width; const int symbology = symbol->symbology; - char *cmd = (char *) testutil_alloca(length + 1024); + char *cmd = (char *) testutil_alloca(bits_len + 1024); const char *zxingcpp_barcode = NULL; const int data_mode = (symbol->input_mode & 0x07) == DATA_MODE; + int set_charset = 0; FILE *fp = NULL; int cnt; buffer[0] = '\0'; - zxingcpp_barcode = testUtilZXingCPPName(index, symbol, source, 0 /*debug*/); + zxingcpp_barcode = testUtilZXingCPPName(index, symbol, source, length, 0 /*debug*/); if (!zxingcpp_barcode) { fprintf(stderr, "i:%d testUtilZXingCPP: no mapping for %s\n", index, testUtilBarcodeName(symbology)); return -1; } - sprintf(cmd, cmd_fmt, width, zxingcpp_barcode, symbology, symbol->option_2, bits); + + if (symbol->eci == 0 && symbol->symbology == BARCODE_HANXIN) { + int converted_len = length; + unsigned char *converted_buf = (unsigned char *) testutil_alloca(converted_len + 1); + set_charset = utf8_to_eci(0, (const unsigned char *) source, converted_buf, &converted_len) != 0; + } + if (set_charset) { + static const char charset[] = "GB18030"; + sprintf(cmd, cs_cmd_fmt, width, zxingcpp_barcode, symbology, symbol->option_2, bits, charset); + } else { + sprintf(cmd, cmd_fmt, width, zxingcpp_barcode, symbology, symbol->option_2, bits); + } if (symbol->debug & ZINT_DEBUG_TEST_PRINT) { printf("i:%d testUtilZXingCPP: cmd %s\n", index, cmd); @@ -3309,9 +3323,10 @@ int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, testutil_pclose(fp); - if (data_mode && is_eci_convertible(symbol->eci)) { + if (data_mode && (is_eci_convertible(symbol->eci) || symbol->eci == 899)) { + const int eci = symbol->eci == 899 ? 3 : symbol->eci; int error_number; - const int eci_length = get_eci_length(symbol->eci, (const unsigned char *) buffer, cnt); + const int eci_length = get_eci_length(eci, (const unsigned char *) buffer, cnt); unsigned char *preprocessed = (unsigned char *) testutil_alloca(eci_length + 1); if (eci_length >= buffer_size) { @@ -3319,11 +3334,11 @@ int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, index, buffer_size, eci_length, cmd); return -1; } - error_number = utf8_to_eci(symbol->eci, (const unsigned char *) buffer, preprocessed, &cnt); + error_number = utf8_to_eci(eci, (const unsigned char *) buffer, preprocessed, &cnt); if (error_number == 0) { memcpy(buffer, preprocessed, cnt); } else { - if (symbol->eci != 0) { + if (eci != 0) { fprintf(stderr, "i:%d testUtilZXingCPP: utf8_to_eci == %d (%s)\n", index, error_number, cmd); return -1; } else { @@ -3605,16 +3620,16 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in upcean[13] = ' '; expected = upcean; } else if (symbology == BARCODE_EANX && (expected_len == 7 - || (strchr(expected, '+') != NULL && (expected_len == 10 || expected_len == 13)))) { + || (strchr(expected, '+') != NULL && (expected_len == 10 || expected_len == 13)))) { memcpy(upcean, expected, 7); upcean[7] = gs1_check_digit((const unsigned char *) upcean, 7); - if (expected_len == 10) { + if (expected_len == 10) { upcean[8] = ' '; memcpy(upcean + 9, expected + 8, 2); - } else if (expected_len == 13) { + } else if (expected_len == 13) { upcean[8] = ' '; memcpy(upcean + 9, expected + 8, 5); - } + } expected_len++; upcean[expected_len] = '\0'; expected = upcean; @@ -3667,3 +3682,5 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/testcommon.h b/backend/tests/testcommon.h index aafb5ee8..d54bb77e 100644 --- a/backend/tests/testcommon.h +++ b/backend/tests/testcommon.h @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2019 - 2021 Robin Stuart + Copyright (C) 2019-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,14 +27,13 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ /* * Adapted from qrencode/tests/common.h * Copyright (C) 2006-2017 Kentaro Fukuchi */ -#ifndef TESTCOMMON_H -#define TESTCOMMON_H +#ifndef Z_TESTCOMMON_H +#define Z_TESTCOMMON_H #define ZINT_DEBUG_TEST_PRINT 16 #define ZINT_DEBUG_TEST_LESS_NOISY 32 @@ -177,9 +176,10 @@ int testUtilBwippCmpRow(const struct zint_symbol *symbol, int row, char *msg, co const char *expected); int testUtilHaveZXingCPPDecoder(void); -int testUtilCanZXingCPP(int index, const struct zint_symbol *symbol, const char *data, const int debug); -int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, char *bits, char *buffer, - const int buffer_size, int *p_cmp_len); +int testUtilCanZXingCPP(int index, const struct zint_symbol *symbol, const char *data, const int length, + const int debug); +int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, const int length, char *bits, + char *buffer, const int buffer_size, int *p_cmp_len); int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, int cmp_len, const char *expected, int expected_len, const char *primary, char *ret_buf, int *p_ret_len); @@ -187,4 +187,5 @@ int testUtilZXingCPPCmp(struct zint_symbol *symbol, char *msg, char *cmp_buf, in } #endif -#endif /* TESTCOMMON_H */ +/* vim: set ts=4 sw=4 et : */ +#endif /* Z_TESTCOMMON_H */ diff --git a/backend/tests/tools/bwipp_dump-barcode.ps.diff b/backend/tests/tools/bwipp_dump-barcode.ps.diff index 7c95d243..ef09d12c 100644 --- a/backend/tests/tools/bwipp_dump-barcode.ps.diff +++ b/backend/tests/tools/bwipp_dump-barcode.ps.diff @@ -1,43 +1,6 @@ ---- /home/mburke/code/gitlost/postscriptbarcode/build/monolithic/barcode.ps 2022-02-10 22:21:47.533942041 +0000 -+++ backend/tests/tools/bwipp_dump.ps 2022-01-02 22:32:35.289274072 +0000 -@@ -206,8 +206,8 @@ - - % --BEGIN RESOURCE gs1lint-- - % --REQUIRES preamble raiseerror-- --%%BeginResource: uk.co.terryburton.bwipp gs1lint 0.0 2021092800 362430 390472 --%%BeginData: 1674 ASCII Lines -+%%BeginResource: uk.co.terryburton.bwipp gs1lint 0.0 2021092800 362243 386853 -+%%BeginData: 1673 ASCII Lines - /setpacking where {pop currentpacking true setpacking} if - 2 dict - dup /raiseerror dup /uk.co.terryburton.bwipp findresource put -@@ -409,7 +409,7 @@ - } bind def - - /lintiban { -- dup length 4 le { pop pop /bwipp.GS1tooShort (IBAN too short) false exit } if -+ dup length 4 lt { pop pop /bwipp.GS1tooShort (IBAN too short) false exit } if - dup true exch { - 1 string dup 0 4 -1 roll put - (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) -@@ -1655,7 +1655,6 @@ - (712) exch dup - (713) exch dup - (714) exch dup -- (715) exch dup - pop - - [ -@@ -7706,7 +7705,7 @@ - % --EXAM: (01)95012345678903(3103)000123 - % --EXOP: - % --RNDR: renlinear renmatrix --%%BeginResource: uk.co.terryburton.bwipp databarexpanded 0.0 2021092800 242827 244887 -+%%BeginResource: uk.co.terryburton.bwipp databarexpanded 0.0 2021092800 242723 244887 - %%BeginData: 886 ASCII Lines - /setpacking where {pop currentpacking true setpacking} if - 1 dict -@@ -15180,8 +15179,8 @@ +--- /home/mburke/code/bwipp/postscriptbarcode/build/monolithic/barcode.ps 2022-04-04 14:55:50.742795871 +0100 ++++ backend/tests/tools/bwipp_dump.ps 2022-04-09 18:28:15.057483295 +0100 +@@ -15187,8 +15187,8 @@ } bind /fime { /sbs [2.25 6.75 2.25 15.75 2.25 6.75 2.25] def @@ -48,7 +11,7 @@ } bind >> def -@@ -26438,34 +26437,80 @@ +@@ -26445,34 +26445,80 @@ pop } ifelse @@ -148,7 +111,7 @@ end -@@ -26524,7 +26569,7 @@ +@@ -26531,7 +26577,7 @@ pop } ifelse @@ -157,7 +120,7 @@ % Get the result of encoding with ean8 and gs1-cc options (lintype) (ean8) put -@@ -26532,29 +26577,75 @@ +@@ -26539,29 +26585,75 @@ options (dontdraw) true put % Plot the linear part @@ -253,7 +216,7 @@ end -@@ -26613,34 +26704,80 @@ +@@ -26620,34 +26712,80 @@ pop } ifelse @@ -353,7 +316,7 @@ end -@@ -26714,34 +26851,80 @@ +@@ -26721,34 +26859,80 @@ /opt options >> def @@ -453,7 +416,7 @@ end -@@ -26800,7 +26983,7 @@ +@@ -26807,7 +26991,7 @@ pop } ifelse @@ -462,7 +425,7 @@ options (lintype) (databaromni) put options (linkage) true put -@@ -26811,7 +26994,7 @@ +@@ -26818,7 +27002,7 @@ linear options //databaromni exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -471,7 +434,7 @@ % Plot the separator /sepfinder { -@@ -26842,20 +27025,66 @@ +@@ -26849,20 +27033,66 @@ sep 0 [0 0 0] putinterval sep sep length 4 sub [0 0 0 0] putinterval 18 sepfinder 64 sepfinder @@ -550,7 +513,7 @@ end -@@ -26913,7 +27142,7 @@ +@@ -26920,7 +27150,7 @@ pop } ifelse @@ -559,7 +522,7 @@ options (lintype) (databarstacked) put options (linkage) true put -@@ -26924,7 +27153,7 @@ +@@ -26931,7 +27161,7 @@ linear options //databarstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -568,7 +531,7 @@ % Plot the separator /sepfinder { -@@ -26952,20 +27181,52 @@ +@@ -26959,20 +27189,52 @@ sep 0 [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder @@ -633,7 +596,7 @@ end -@@ -27023,7 +27284,7 @@ +@@ -27030,7 +27292,7 @@ pop } ifelse @@ -642,7 +605,7 @@ options (lintype) (databarstackedomni) put options (linkage) true put -@@ -27034,7 +27295,7 @@ +@@ -27041,7 +27303,7 @@ linear options //databarstackedomni exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -651,7 +614,7 @@ % Plot the separator /sepfinder { -@@ -27062,20 +27323,52 @@ +@@ -27069,20 +27331,52 @@ sep 0 [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder @@ -716,7 +679,7 @@ end -@@ -27248,7 +27541,7 @@ +@@ -27255,7 +27549,7 @@ pop } ifelse @@ -725,7 +688,7 @@ options (lintype) (databarlimited) put options (linkage) true put -@@ -27259,7 +27552,7 @@ +@@ -27266,7 +27560,7 @@ linear options //databarlimited exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -734,7 +697,7 @@ % Plot the separator mark -@@ -27267,22 +27560,68 @@ +@@ -27274,22 +27568,68 @@ counttomark 1 sub array astore /sep exch def pop pop sep 0 [0 0 0] putinterval sep sep length 9 sub [0 0 0 0 0 0 0 0 0] putinterval % 4 + 5 right guard spaces @@ -772,8 +735,7 @@ + /compsym comp options //gs1-cc exec def + /ccpixs compsym /pixs get def + /ccpixx compsym /pixx get def - -- grestore ++ + /linpixs [ 0 % Begin with left guard space + linsbs { cvi 1 index 0 eq {{1}} {{0}} ifelse repeat } forall % Alternates x 1/0's + ] def @@ -802,7 +764,8 @@ + ] def + /pixx ccpixx 1 add def + } ifelse -+ + +- grestore + /pixy pixs length pixx idiv def + << + /ren //renmatrix @@ -817,7 +780,7 @@ end -@@ -27341,7 +27680,7 @@ +@@ -27348,7 +27688,7 @@ pop } ifelse @@ -826,7 +789,7 @@ options (lintype) (databarexpanded) put options (linkage) true put -@@ -27352,7 +27691,7 @@ +@@ -27359,7 +27699,7 @@ linear options //databarexpanded exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -835,7 +798,7 @@ % Plot the separator /sepfinder { -@@ -27381,20 +27720,60 @@ +@@ -27388,20 +27728,60 @@ 18 98 bot length 13 sub {} for 69 98 bot length 13 sub {} for ] {sepfinder} forall @@ -908,7 +871,7 @@ end -@@ -27452,7 +27831,7 @@ +@@ -27459,7 +27839,7 @@ pop } ifelse @@ -917,7 +880,7 @@ options (lintype) (databarexpandedstacked) put options (linkage) true put -@@ -27463,7 +27842,7 @@ +@@ -27470,7 +27850,7 @@ linear options //databarexpandedstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -926,7 +889,7 @@ % Plot the separator /sepfinder { -@@ -27489,21 +27868,49 @@ +@@ -27496,21 +27876,49 @@ 19 98 bot length 13 sub {} for 70 98 bot length 13 sub {} for ] {sepfinder} forall @@ -989,7 +952,7 @@ end -@@ -27562,7 +27969,7 @@ +@@ -27569,7 +27977,7 @@ pop } ifelse @@ -998,7 +961,7 @@ options (inkspread) (0) put options (dontdraw) true put -@@ -27589,35 +27996,87 @@ +@@ -27596,35 +28004,87 @@ linear << options {} forall >> //gs1-128 exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -1100,16 +1063,7 @@ end -@@ -28074,7 +28533,7 @@ - % --EXAM: (235)5vBZIF%! +# Copyright (C) 2021-2022 Robin Stuart # vim: set ts=4 sw=4 et : set -e @@ -15,6 +15,7 @@ run_zxingcpp_test "test_code128" "encode" run_zxingcpp_test "test_dmatrix" "input" run_zxingcpp_test "test_dmatrix" "encode" run_zxingcpp_test "test_dotcode" "encode" +run_zxingcpp_test "test_hanxin" "encode" run_zxingcpp_test "test_maxicode" "encode" run_zxingcpp_test "test_medical" "encode" run_zxingcpp_test "test_pdf417" "encode" diff --git a/backend_qt/qzint.cpp b/backend_qt/qzint.cpp index 827a6690..e02a3e63 100644 --- a/backend_qt/qzint.cpp +++ b/backend_qt/qzint.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2008 by BogDan Vatra * * bogdan@licentia.eu * - * Copyright (C) 2010-2021 Robin Stuart * + * Copyright (C) 2010-2022 Robin Stuart * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -14,7 +14,6 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ -/* vim: set ts=4 sw=4 et : */ #ifdef _MSC_VER #if _MSC_VER >= 1900 /* MSVC 2015 */ @@ -459,9 +458,11 @@ namespace Zint { m_eci = ECIIndex + 2; } else if (ECIIndex >= 12 && ECIIndex <= 15) { m_eci = ECIIndex + 3; - } else if (ECIIndex >= 16 && ECIIndex <= 26) { + } else if (ECIIndex >= 16 && ECIIndex <= 31) { m_eci = ECIIndex + 4; - } else if (ECIIndex == 27) { + } else if (ECIIndex == 32) { + m_eci = 170; /* ISO 646 Invariant */ + } else if (ECIIndex == 33) { m_eci = 899; /* 8-bit binary data */ } else { m_eci = 0; @@ -469,7 +470,7 @@ namespace Zint { } void QZint::setECIValue(int eci) { // Sets literal value - if (eci < 3 || (eci > 30 && eci != 899) || eci == 14 || eci == 19) { + if (eci < 3 || (eci > 35 && eci != 170 && eci != 899) || eci == 14 || eci == 19) { m_eci = 0; } else { m_eci = eci; @@ -1055,3 +1056,5 @@ namespace Zint { } } } /* namespace Zint */ + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend_qt/tests/test_qzint.cpp b/backend_qt/tests/test_qzint.cpp index 1683ceb2..6de3ec9b 100644 --- a/backend_qt/tests/test_qzint.cpp +++ b/backend_qt/tests/test_qzint.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2021 by Robin Stuart * + * Copyright (C) 2021-2022 by Robin Stuart * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -12,7 +12,6 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ -/* vim: set ts=4 sw=4 et : */ #include #include "../qzint.h" /* Don't use in case it's been changed */ @@ -193,7 +192,8 @@ private slots: int ecis[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 899, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 170, 899, }; for (int i = 0; i < ARRAY_SIZE(ecis); i++) { bc.setECI(i); @@ -243,7 +243,10 @@ private slots: QTest::newRow("2") << 2 << 0; QTest::newRow("14") << 14 << 0; QTest::newRow("19") << 19 << 0; - QTest::newRow("31") << 31 << 0; + QTest::newRow("31") << 31 << 31; + QTest::newRow("36") << 36 << 0; + QTest::newRow("169") << 169 << 0; + QTest::newRow("171") << 171 << 0; QTest::newRow("898") << 898 << 0; QTest::newRow("900") << 900 << 0; QTest::newRow("1000") << 1000 << 0; @@ -974,3 +977,5 @@ private slots: QTEST_MAIN(TestQZint) #include "test_qzint.moc" + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend_tcl/zint.c b/backend_tcl/zint.c index ccfcfac7..5e849436 100644 --- a/backend_tcl/zint.c +++ b/backend_tcl/zint.c @@ -1,7 +1,7 @@ /* zint_tcl.c TCL binding for zint */ /* zint - the open source tcl binding to the zint barcode library - Copyright (C) 2014 Harald Oehlmann + Copyright (C) 2014-2022 Harald Oehlmann Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -28,7 +28,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ /* History @@ -139,6 +138,9 @@ - Added DBAR_EXPSTK, CODE16K, CODE49 -rows 2021-12-17 GL - Added -fast option +2022-04-08 GL +- Updated ECIs to AIM ITS/04-023:2022 + Note changed names "unicode" -> "utf-16be", "euc-cn" -> "gb2312" */ #if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) @@ -427,18 +429,24 @@ static const char *s_eci_list[] = { "cp1251", /*22: Windows-1251*/ "cp1252", /*23: Windows-1252*/ "cp1256", /*24: Windows-1256*/ - "unicode", /*25: UCS-2BE (High order byte first) Unicode BMP*/ + "utf-16be", /*25: UTF-16BE (High order byte first) Unicode*/ "utf-8", /*26: Unicode (UTF-8)*/ "ascii", /*27: ISO-646:1991 7-bit character set*/ "big5", /*28: Big5 (Taiwan) Chinese Character Set*/ - "euc-cn", /*29: GB (PRC) Chinese Character Set*/ + "gb2312", /*29: GB 2312 (PRC) Chinese Character Set*/ "iso2022-kr", /*30: Korean Character Set EUC-KR (KS X 1001:2002)*/ + "gbk", /*31: GBK Chinese Character Set*/ + "gb18030", /*32: GB 18030 Chinese Character Set*/ + "utf-16le", /*33: UTF-16LE (Low order byte first) Unicode*/ + "utf-32be", /*34: UTF-32BE (High order byte first) Unicode*/ + "utf-32le", /*35: UTF-32BE (Low order byte first) Unicode*/ NULL }; /* The ECI numerical number to pass to ZINT */ static const int s_eci_number[] = { - 3,4,5,6,7,8,9,10,11,12,13,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30 + 3,4,5,6,7,8,9,10,11,12,13,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30, + 31,32,33,34,35 }; /* Version information */ @@ -1403,3 +1411,5 @@ static int Encode(Tcl_Interp *interp, int objc, } return TCL_OK; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/docs/manual.txt b/docs/manual.txt index 2b8ace9d..c6f82d8e 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -670,9 +670,6 @@ The ECI value of 0 does not encode any ECI information in the code symbol. In this case, the default encoding applies for the data which is "ISO/IEC 8859-1 - Latin alphabet No. 1". -The row marked with an asterisk (*) translates GB 2312 codepoints, except when -using Han Xin Code, which translates GB 18030 codepoints, a superset of GB 2312. - Note: the "--eci=3" specification should only be used for special purposes. Using this parameter, the ECI information is explicitly added to the code symbol. Nevertheless, for ECI Code 3, this is not required, as this is the @@ -701,12 +698,18 @@ ECI Code | Character Encoding Scheme 22 | Windows 1251 - Cyrillic 23 | Windows 1252 - Latin 1 24 | Windows 1256 - Arabic -25 | UCS-2BE (High order byte first) (Unicode BMP) +25 | UTF-16BE (High order byte first) 26 | UTF-8 (Unicode) 27 | ISO/IEC 646:1991 7-bit character set (ASCII) 28 | Big5 (Taiwan) Chinese Character Set -29 * | GB (PRC) Chinese Character Set +29 | GB 2312 (PRC) Chinese Character Set 30 | Korean Character Set EUC-KR (KS X 1001:2002) +31 | GBK Chinese Character Set +32 | GB 18030 Chinese Character Set +33 | UTF-16LE (Low order byte first) +34 | UTF-32BE (High order bytes first) +35 | UTF-32LE (Low order bytes first) +170 | ISO/IEC 646:1991 7-bit character set (Invariant) 899 | 8-bit binary data ------------------------------------------------------------ @@ -1523,11 +1526,12 @@ FAST_MODE | Use faster if less optimal encodation for symbologies that | support it (currently DATAMATRIX only). -------------------------------------------------------------------------------- -The default mode is DATA_MODE. +The default mode is DATA_MODE. (Note that this differs from the default for the +CLI and GUI, which is UNICODE_MODE.) -DATA_MODE, UNICODE_MODE and GS1_MODE are mutually exclusive, whereas ESCAPE_MODE, -GS1PARENS_MODE, GS1NOCHECK_MODE and HEIGHTPERROW_MODE are optional. So, for -example, you can set +DATA_MODE, UNICODE_MODE and GS1_MODE are mutually exclusive, whereas +ESCAPE_MODE, GS1PARENS_MODE, GS1NOCHECK_MODE, HEIGHTPERROW_MODE and FAST_MODE +are optional. So, for example, you can set my_symbol->input_mode = UNICODE_MODE | ESCAPE_MODE; @@ -1579,7 +1583,7 @@ returned on success. For instance: char name[32]; if (ZBarcode_BarcodeName(BARCODE_PDF417, name) == 0) { - printf("%s\n", name); + printf("%s\n", name); } will print "BARCODE_PDF417". @@ -3199,7 +3203,7 @@ default value is 250 (25%). ================================ 7.1 License ----------- -Zint, libzint and Zint Barcode Studio are Copyright © 2021 Robin Stuart. All +Zint, libzint and Zint Barcode Studio are Copyright © 2022 Robin Stuart. All historical versions are distributed under the GNU General Public License version 3 or later. Version 2.5 (and later) is released under a dual license: the encoding library is released under the BSD license whereas the GUI, Zint @@ -3283,9 +3287,8 @@ international standards: capture techniques - Code 39 bar code symbology specification > ISO/IEC 18004:2015 Information technology - Automatic identification and data capture techniques - QR Code bar code symbology specification -> ISO/IEC DIS 20830:2019 (Draft 2019-10-10) Information technology - Automatic - identification and data capture techniques - Han Xin Code bar code - symbology specification +> ISO/IEC 20830:2021 Information technology - Automatic identification and data + capture techniques - Han Xin Code bar code symbology specification > ISO/IEC 24723:2010 Information technology - Automatic identification and data capture techniques - GS1 Composite bar code symbology specification > ISO/IEC 24724:2011 Information technology - Automatic identification and data @@ -3317,12 +3320,12 @@ international standards: (Released 9th Dec 2008) > AIMD/TSC15032-43 (v 0.99c) - International Technical Specification - Ultracode Symbology (Draft) (Released 4th Nov 2015) -> GS1 General Specifications Release 21.0.1 (Jan 2021) +> GS1 General Specifications Release 22.0 (Jan 2022) > AIM ITS/04-001 International Technical Standard - Extended Channel Interpretations Part 1: Identification Schemes and Protocol (Released 24th May 2004) > AIM ITS/04-023 International Technical Standard - Extended Channel - Interpretations Part 3: Register (Released 15th July 2004) + Interpretations Part 3: Register (Version 2, February 2022) A. Character Encoding diff --git a/frontend/main.c b/frontend/main.c index 8ac75041..d1e767b8 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -2,7 +2,7 @@ /* libzint - the open source barcode library - Copyright (C) 2008-2021 Robin Stuart + Copyright (C) 2008-2022 Robin Stuart This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* vim: set ts=4 sw=4 et : */ #include #include @@ -200,14 +199,19 @@ static void show_eci(void) { " 22: Windows 1251 - Cyrillic\n" " 23: Windows 1252 - Latin 1\n" " 24: Windows 1256 - Arabic\n" - " 25: UCS-2BE (High order byte first) (Unicode BMP)\n" + " 25: UTF-16BE (High order byte first)\n" " 26: UTF-8 (Unicode)\n" - " 27: ISO/IEC 646:1991 7-bit character set (ASCII)\n" + " 27: ISO/IEC 646:1991 7-bit ASCII\n" " 28: Big5 (Taiwan) Chinese Character Set\n" - " 29: ** GB (PRC) Chinese Character Set\n" + " 29: GB 2312 (PRC) Chinese Character Set\n" " 30: Korean Character Set EUC-KR (KS X 1001:2002)\n" + " 31: GBK Chinese Character Set\n" + " 32: GB 18030 Chinese Character Set\n" + " 33: UTF-16LE (Low order byte first)\n" + " 34: UTF-32BE (High order bytes first)\n" + " 35: UTF-32LE (Low order bytes first)\n" + "170: ISO/IEC 646:1991 7-bit Invariant\n" "899: 8-bit binary data\n" - "** ECI 29 is GB 2312 except for Han Xin, when it is GB 18030\n" ); } @@ -1479,3 +1483,5 @@ int main(int argc, char **argv) { return do_exit(error_number); } + +/* vim: set ts=4 sw=4 et : */ diff --git a/frontend/tests/test_args.c b/frontend/tests/test_args.c index 61c9de8e..9954c0ca 100644 --- a/frontend/tests/test_args.c +++ b/frontend/tests/test_args.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2020 - 2021 Robin Stuart + Copyright (C) 2020-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ #include "testcommon.h" @@ -302,15 +301,15 @@ static void test_dump_args(int index, int debug) { /* 30*/ { BARCODE_DATAMATRIX, "(9\\x31)12(92)34", NULL, NULL, NULL, GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" }, /* 31*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, "12345678+12", -1, -1, 0, -1, "DB BC D3 9C 44 E9 D2 2C 19 E7 A2 D8 A0 00 00 00\nDB 31 1C 9C C7 29 92 47 D9 E9 40 C8 A0 00 00 00\nDA 3B EB 10 AF 09 9A 18 9D 7D 82 E8 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" }, /* 32*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, 2, "12345678+12", -1, -1, 0, -1, "D3 A3 E9 DB F5 C9 DB 43 D9 CB 98 D2 20 00 00 00\nD3 25 0F 11 E4 49 D3 51 F1 AC FC D6 20 00 00 00\nD1 33 48 19 39 E9 93 18 49 D8 98 D7 20 00 00 00\nD1 A6 FC DA 1C 49 9B C5 05 E2 84 D7 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" }, - /* 33*/ { BARCODE_QRCODE, "点", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" }, + /* 33*/ { BARCODE_QRCODE, "点", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "Warning 543: Converted to Shift JIS but no ECI specified\nFE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" }, /* 34*/ { BARCODE_QRCODE, "点", NULL, NULL, NULL, -1, -1, 0, -1, 0, 26, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 5B F8\n82 72 08\nBA DA E8\nBA 52 E8\nBA 2A E8\n82 0A 08\nFE AB F8\n00 D8 00\nEF F6 20\nB5 C2 28\n36 28 88\nFD 42 10\n62 2A C8\n00 95 70\nFE B7 38\n82 FD D8\nBA 97 00\nBA 43 60\nBA C8 C8\n82 C3 68\nFE EA F8" }, /* 35*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 0A 08\nBA A2 E8\nBA 0A E8\nBA 5A E8\n82 72 08\nFE AB F8\n00 A0 00\nEF AE 20\n75 B5 20\n82 F7 58\nF4 9D C8\n5E 17 28\n00 C2 20\nFE 88 80\n82 82 38\nBA EA A8\nBA 55 50\nBA D7 68\n82 BD D0\nFE B7 78" }, /* 36*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" }, /* 37*/ { BARCODE_QRCODE, "\\x93\\x5F", NULL, NULL, NULL, DATA_MODE | ESCAPE_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" }, - /* 38*/ { BARCODE_QRCODE, "点", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, 2, -1, NULL, -1, 1, 0, -1, "FE 4B F8\n82 92 08\nBA 42 E8\nBA 92 E8\nBA 3A E8\n82 EA 08\nFE AB F8\n00 38 00\nFB CD 50\nA5 89 18\n0B 74 B8\nFC 81 A0\n92 34 B8\n00 DE 48\nFE AB 10\n82 5E 50\nBA C9 20\nBA C9 20\nBA F4 E0\n82 81 A0\nFE B4 E8" }, - /* 39*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 AA\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\nAA 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" }, - /* 40*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 3, -1, NULL, -1, -1, 0, -1, "FE 16 FE\n80 E2 02\nBE C2 FA\nA0 A0 0A\nAE F6 EA\nAE 98 EA\nAE BA EA\n00 E0 00\n15 83 AA\n44 7E AE\n92 9C 78\n25 BF 08\n47 4B 8C\n0D F9 74\nAB E7 50\n00 3A 00\nFE C2 EA\n02 22 EA\nFA DA EA\n0A 22 0A\nEA B2 FA\nEA 9A 02\nEA E8 FE" }, - /* 41*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 4, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 AA\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\nAA 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" }, + /* 38*/ { BARCODE_QRCODE, "点", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, 2, -1, NULL, -1, 1, 0, -1, "Warning 543: Converted to Shift JIS but no ECI specified\nFE 4B F8\n82 92 08\nBA 42 E8\nBA 92 E8\nBA 3A E8\n82 EA 08\nFE AB F8\n00 38 00\nFB CD 50\nA5 89 18\n0B 74 B8\nFC 81 A0\n92 34 B8\n00 DE 48\nFE AB 10\n82 5E 50\nBA C9 20\nBA C9 20\nBA F4 E0\n82 81 A0\nFE B4 E8" }, + /* 39*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 80\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\n02 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" }, + /* 40*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 3, -1, NULL, -1, -1, 0, -1, "FE 16 FE\n80 E2 02\nBE C2 FA\nA0 A0 0A\nAE F6 EA\nAE 98 EA\nAE BA EA\n00 E0 00\n15 83 80\n44 7E AE\n92 9C 78\n25 BF 08\n47 4B 8C\n0D F9 74\n03 E7 50\n00 3A 00\nFE C2 EA\n02 22 EA\nFA DA EA\n0A 22 0A\nEA B2 FA\nEA 9A 02\nEA E8 FE" }, + /* 41*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 4, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 80\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\n02 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" }, }; int data_size = ARRAY_SIZE(data); int i; @@ -1013,3 +1012,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/frontend_qt/mainWindow.ui b/frontend_qt/mainWindow.ui index 8655988b..b9844af2 100644 --- a/frontend_qt/mainWindow.ui +++ b/frontend_qt/mainWindow.ui @@ -425,6 +425,9 @@ Remember to place [square brackets] around AI identifiers 0 + + 34 + Set the ECI (Extended Channel Interpretation) code (ignored if disabled) @@ -536,7 +539,7 @@ Remember to place [square brackets] around AI identifiers - 25: UCS-2BE + 25: UTF-16BE @@ -564,6 +567,36 @@ Remember to place [square brackets] around AI identifiers 30: Korean EUC-KR + + + 31: GBK + + + + + 32: GB 18030 + + + + + 33: UTF-16LE + + + + + 34: UTF-32BE + + + + + 35: UTF-32LE + + + + + 170: ISO 646 Invariant + + 899: 8-bit binary data diff --git a/frontend_qt/mainwindow.cpp b/frontend_qt/mainwindow.cpp index 28761e33..7864e662 100644 --- a/frontend_qt/mainwindow.cpp +++ b/frontend_qt/mainwindow.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2008 by BogDan Vatra * - * Copyright (C) 2009-2021 by Robin Stuart * + * Copyright (C) 2009-2022 by Robin Stuart * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ -/* vim: set ts=4 sw=4 et : */ //#include #include @@ -461,7 +460,7 @@ void MainWindow::about() "

A free barcode generator

" "

Instruction manual is available at the project homepage:
" "http://www.zint.org.uk" - "

Copyright © 2006-2021 Robin Stuart and others.
" + "

Copyright © 2006-2022 Robin Stuart and others.
" "Qt backend by BogDan Vatra

" "

Qt version %2

" "

With thanks to Harald Oehlmann, Norbert Szabó, Robert Elliott, Milton Neal, " @@ -953,7 +952,6 @@ void MainWindow::change_options() chkComposite->setText(tr("Add &2D Component")); combobox_item_enabled(cmbCompType, 3, false); // CC-C - cmbECI->setItemText(25, tr("29: GB 2312 (PRC)")); btype->setItemText(0, tr("No border")); combobox_item_enabled(cmbFontSetting, 1, true); m_lblHeightPerRow = nullptr; @@ -1294,7 +1292,6 @@ void MainWindow::change_options() file.close(); load_sub_settings(settings, symbology); tabMain->insertTab(1, m_optionWidget, tr("Han Xin Cod&e")); - cmbECI->setItemText(25, tr("29: GB 18030 (PRC)")); connect(get_widget(QSL("cmbHXSize")), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(get_widget(QSL("cmbHXECC")), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(get_widget(QSL("cmbHXMask")), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); @@ -3415,3 +3412,5 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology) break; } } + +/* vim: set ts=4 sw=4 et : */