diff --git a/backend/gridmtx.c b/backend/gridmtx.c index 765189b7..b8134018 100644 --- a/backend/gridmtx.c +++ b/backend/gridmtx.c @@ -667,7 +667,7 @@ static int gm_encode(unsigned int gbdata[], const int length, char binary[], con if (shift == 0) { /* Mixed Mode character */ - glyph = posn(EUROPIUM, gbdata[sp]); + glyph = posn(EUROPIUM, (const char) gbdata[sp]); if (debug & ZINT_DEBUG_PRINT) { printf("[%d] ", glyph); } @@ -692,7 +692,7 @@ static int gm_encode(unsigned int gbdata[], const int length, char binary[], con if (shift == 0) { /* Upper Case character */ - glyph = posn("ABCDEFGHIJKLMNOPQRSTUVWXYZ ", gbdata[sp]); + glyph = posn("ABCDEFGHIJKLMNOPQRSTUVWXYZ ", (const char) gbdata[sp]); if (debug & ZINT_DEBUG_PRINT) { printf("[%d] ", glyph); } @@ -717,7 +717,7 @@ static int gm_encode(unsigned int gbdata[], const int length, char binary[], con if (shift == 0) { /* Lower Case character */ - glyph = posn("abcdefghijklmnopqrstuvwxyz ", gbdata[sp]); + glyph = posn("abcdefghijklmnopqrstuvwxyz ", (const char) gbdata[sp]); if (debug & ZINT_DEBUG_PRINT) { printf("[%d] ", glyph); } diff --git a/backend/library.c b/backend/library.c index ab1d193e..18bc5855 100644 --- a/backend/library.c +++ b/backend/library.c @@ -1307,6 +1307,9 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int } return error_tag(symbol->errtxt, error_number); } + if (error_number && warn_number == 0) { + warn_number = error_number; + } ustrcpy(local_source, reduced); // Cannot contain nul char in_length = (int) ustrlen(local_source); } diff --git a/backend/raster.c b/backend/raster.c index a71f3d27..23056b51 100644 --- a/backend/raster.c +++ b/backend/raster.c @@ -2,7 +2,7 @@ /* libzint - the open source barcode library - Copyright (C) 2009 - 2020 Robin Stuart + Copyright (C) 2009 - 2021 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -36,6 +36,10 @@ #include #include #include +/* For Visual C++ 6 suppress conversion from int to float warning */ +#if _MSC_VER == 1200 +#pragma warning(disable: 4244) +#endif #endif #include #include diff --git a/backend/tests/test_composite.c b/backend/tests/test_composite.c index 8e95d38b..e40f28c1 100644 --- a/backend/tests/test_composite.c +++ b/backend/tests/test_composite.c @@ -1608,7 +1608,7 @@ static void test_ean128_cc_width(int index, int generate, int debug) { /* 8*/ { "[91]123A1234A", "[02]13012345678909", 0, 5, 174, "" }, /* 9*/ { "[91]123A1234A1", "[02]13012345678909", 0, 5, 188, "" }, /*10*/ { "[91]123A1234A12", "[02]13012345678909", 0, 5, 205, "" }, - /*11*/ { "[00]123456789012345675", "[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345678[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[91]1234567890", 0, 32, 579, "With composite 2372 digits == max" }, + /*11*/ { "[00]123456789012345675", "[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[91]1234567890", 0, 32, 579, "With composite 2372 digits == max" }, /*12*/ { "[00]123456789012345675", "[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[00]123456789012345675[91]12345678901", ZINT_ERROR_TOO_LONG, 0, 0, "With composite 2373 digits > max" }, }; int data_size = sizeof(data) / sizeof(struct item); diff --git a/backend/tests/test_dotcode.c b/backend/tests/test_dotcode.c index b97ae5bc..637e3883 100644 --- a/backend/tests/test_dotcode.c +++ b/backend/tests/test_dotcode.c @@ -69,7 +69,7 @@ static void test_input(int index, int generate, int debug) { /* 20*/ { UNICODE_MODE, -1, "[)>\03606A\004", -1, 0, "6A 64 10 16 21", "[)>RS 06 A EOT; LatchB (0x6A) Macro100 (0x64) 0 6 A" }, /* 21*/ { UNICODE_MODE, -1, "[)>\036991\036\004", -1, 0, "6A 64 19 19 11 64", "[)>RS 99 1 RS EOT; LatchB (0x6A) Macro100 (0x64) 9 9 1 RS" }, /* 22*/ { UNICODE_MODE, -1, "1712345610", -1, 0, "6B 64 0C 22 38", "FNC1 (0x6B) 17..10 12 34 56" }, - /* 23*/ { GS1_MODE, -1, "[17]123456[10]123", -1, 0, "64 0C 22 38 0C 66 13", "17..10 12 34 56 12 ShiftB (0x66) 3" }, + /* 23*/ { GS1_MODE, -1, "[17]123456[10]123", -1, ZINT_WARN_NONCOMPLIANT, "Warning 64 0C 22 38 0C 66 13", "17..10 12 34 56 12 ShiftB (0x66) 3" }, /* 24*/ { GS1_MODE, -1, "[90]ABC[90]abc[90]123", -1, 0, "5A 6A 21 22 23 6B 19 10 41 42 43 6B 19 67 01 17", "90 LatchB (0x6A) A B C FNC1 (0x6B) 9 0 a b c FNC1 (0x6B) 9 2xShitfC (0x67) 01 23" }, /* 25*/ { UNICODE_MODE, -1, "99aA[{00\000", 9, 0, "6B 63 6A 41 21 3B 5B 10 10 65 40", "FNC1 (0x6B) 99 LatchB (0x6A) a A [ { 0 0 ShiftA (0x65) NUL" }, /* 26*/ { UNICODE_MODE, -1, "\015\012", -1, 0, "66 60", "ShiftB (0x66) CR/LF" }, diff --git a/backend/tests/test_gs1.c b/backend/tests/test_gs1.c index 82a42e5b..f7595a5c 100644 --- a/backend/tests/test_gs1.c +++ b/backend/tests/test_gs1.c @@ -319,967 +319,969 @@ static void test_gs1_verify(int index, int debug) { /* 9*/ { "[00]123456789012345678", ZINT_WARN_NONCOMPLIANT, "00123456789012345678" }, /* 10*/ { "[00]123456789012345675", 0, "00123456789012345675" }, /* 11*/ { "[00]12345678901234567", ZINT_ERROR_INVALID_DATA, "" }, - /* 12*/ { "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "0112345678901234" }, - /* 13*/ { "[01]12345678901231", 0, "0112345678901231" }, - /* 14*/ { "[01]123456789012345", ZINT_ERROR_INVALID_DATA, "" }, - /* 15*/ { "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, "0212345678901234" }, - /* 16*/ { "[02]12345678901231", 0, "0212345678901231" }, - /* 17*/ { "[02]1234567890123", ZINT_ERROR_INVALID_DATA, "" }, - /* 18*/ { "[03]12345678901234", ZINT_ERROR_INVALID_DATA, "" }, - /* 19*/ { "[04]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 20*/ { "[05]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 21*/ { "[06]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 22*/ { "[07]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 23*/ { "[08]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 24*/ { "[09]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 25*/ { "[10]ABCD123456", 0, "10ABCD123456" }, - /* 26*/ { "[10]123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /* 27*/ { "[100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 28*/ { "[1000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 29*/ { "[11]990102", 0, "11990102" }, - /* 30*/ { "[11]9901023", ZINT_ERROR_INVALID_DATA, "" }, - /* 31*/ { "[110]990102", ZINT_ERROR_INVALID_DATA, "" }, - /* 32*/ { "[1100]990102", ZINT_ERROR_INVALID_DATA, "" }, - /* 33*/ { "[12]000100", 0, "12000100" }, - /* 34*/ { "[12]00010", ZINT_ERROR_INVALID_DATA, "" }, - /* 35*/ { "[120]000100", ZINT_ERROR_INVALID_DATA, "" }, - /* 36*/ { "[1200]000100", ZINT_ERROR_INVALID_DATA, "" }, - /* 37*/ { "[13]991301", ZINT_WARN_NONCOMPLIANT, "13991301" }, - /* 38*/ { "[13]991201", 0, "13991201" }, - /* 39*/ { "[13]9913011", ZINT_ERROR_INVALID_DATA, "" }, - /* 40*/ { "[130]991301", ZINT_ERROR_INVALID_DATA, "" }, - /* 41*/ { "[1300]991301", ZINT_ERROR_INVALID_DATA, "" }, - /* 42*/ { "[14]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 43*/ { "[140]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 44*/ { "[1400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 45*/ { "[15]021231", 0, "15021231" }, - /* 46*/ { "[15]02123", ZINT_ERROR_INVALID_DATA, "" }, - /* 47*/ { "[150]021231", ZINT_ERROR_INVALID_DATA, "" }, - /* 48*/ { "[1500]021231", ZINT_ERROR_INVALID_DATA, "" }, - /* 49*/ { "[16]000000", ZINT_WARN_NONCOMPLIANT, "16000000" }, - /* 50*/ { "[16]000100", 0, "16000100" }, - /* 51*/ { "[16]00000", ZINT_ERROR_INVALID_DATA, "" }, - /* 52*/ { "[160]000000", ZINT_ERROR_INVALID_DATA, "" }, - /* 53*/ { "[1600]000000", ZINT_ERROR_INVALID_DATA, "" }, - /* 54*/ { "[17]010200", 0, "17010200" }, - /* 55*/ { "[17]0102000", ZINT_ERROR_INVALID_DATA, "" }, - /* 56*/ { "[170]010200", ZINT_ERROR_INVALID_DATA, "" }, - /* 57*/ { "[1700]010200", ZINT_ERROR_INVALID_DATA, "" }, - /* 58*/ { "[18]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 59*/ { "[180]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 60*/ { "[1800]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 61*/ { "[19]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 62*/ { "[190]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 63*/ { "[1900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 64*/ { "[20]12", 0, "2012" }, - /* 65*/ { "[20]1", ZINT_ERROR_INVALID_DATA, "" }, - /* 66*/ { "[200]12", ZINT_ERROR_INVALID_DATA, "" }, - /* 67*/ { "[2000]12", ZINT_ERROR_INVALID_DATA, "" }, - /* 68*/ { "[21]A12345678", 0, "21A12345678" }, - /* 69*/ { "[21]123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /* 70*/ { "[210]A12345678", ZINT_ERROR_INVALID_DATA, "" }, - /* 71*/ { "[2100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 72*/ { "[22]abcdefghijklmnopqrst", 0, "22abcdefghijklmnopqrst" }, - /* 73*/ { "[22]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /* 74*/ { "[220]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 75*/ { "[2200]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 76*/ { "[23]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 77*/ { "[230]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 78*/ { "[2300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 79*/ { "[235]1abcdefghijklmnopqrstuvwxyz0", 0, "2351abcdefghijklmnopqrstuvwxyz0" }, - /* 80*/ { "[235]1abcdefghijklmnopqrstuvwxyz01", ZINT_ERROR_INVALID_DATA, "" }, - /* 81*/ { "[24]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 82*/ { "[240]abcdefghijklmnopqrstuvwxyz1234", 0, "240abcdefghijklmnopqrstuvwxyz1234" }, - /* 83*/ { "[240]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /* 84*/ { "[2400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 85*/ { "[241]abcdefghijklmnopqrstuvwxyz1234", 0, "241abcdefghijklmnopqrstuvwxyz1234" }, - /* 86*/ { "[241]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /* 87*/ { "[2410]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 88*/ { "[242]12345", 0, "24212345" }, - /* 89*/ { "[242]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /* 90*/ { "[2420]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 91*/ { "[243]abcdefghijklmnopqrst", 0, "243abcdefghijklmnopqrst" }, - /* 92*/ { "[243]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /* 93*/ { "[2430]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 94*/ { "[244]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 95*/ { "[2440]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 96*/ { "[249]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 97*/ { "[2490]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 98*/ { "[25]1234", ZINT_ERROR_INVALID_DATA, "" }, - /* 99*/ { "[250]abcdefghijklmnopqrstuvwxyz1234", 0, "250abcdefghijklmnopqrstuvwxyz1234" }, - /*100*/ { "[250]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*101*/ { "[2500]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*102*/ { "[251]abcdefghijklmnopqrstuvwxyz1234", 0, "251abcdefghijklmnopqrstuvwxyz1234" }, - /*103*/ { "[251]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*104*/ { "[2510]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*105*/ { "[252]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*106*/ { "[2520]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*107*/ { "[253]131313131313", ZINT_ERROR_INVALID_DATA, "" }, - /*108*/ { "[253]1313131313134", ZINT_WARN_NONCOMPLIANT, "2531313131313134" }, - /*109*/ { "[253]1313131313130", 0, "2531313131313130" }, - /*110*/ { "[253]131313131313412345678901234567", ZINT_WARN_NONCOMPLIANT, "253131313131313412345678901234567" }, - /*111*/ { "[253]131313131313012345678901234567", 0, "253131313131313012345678901234567" }, - /*112*/ { "[253]1313131313134123456789012345678", ZINT_ERROR_INVALID_DATA, "" }, - /*113*/ { "[2530]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*114*/ { "[254]abcdefghijklmnopqrst", 0, "254abcdefghijklmnopqrst" }, - /*115*/ { "[254]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*116*/ { "[2540]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*117*/ { "[255]131313131313", ZINT_ERROR_INVALID_DATA, "" }, - /*118*/ { "[255]1313131313134", ZINT_WARN_NONCOMPLIANT, "2551313131313134" }, - /*119*/ { "[255]1313131313130", 0, "2551313131313130" }, - /*120*/ { "[255]1313131313134123456789012", ZINT_WARN_NONCOMPLIANT, "2551313131313134123456789012" }, - /*121*/ { "[255]1313131313130123456789012", 0, "2551313131313130123456789012" }, - /*122*/ { "[255]13131313131341234567890123", ZINT_ERROR_INVALID_DATA, "" }, - /*123*/ { "[2550]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*124*/ { "[256]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*125*/ { "[2560]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*126*/ { "[259]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*127*/ { "[2590]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*128*/ { "[26]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*129*/ { "[260]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*130*/ { "[2600]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*131*/ { "[27]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*132*/ { "[270]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*133*/ { "[2700]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*134*/ { "[28]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*135*/ { "[280]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*136*/ { "[2800]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*137*/ { "[29]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*138*/ { "[290]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*139*/ { "[2900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*140*/ { "[30]12345678", 0, "3012345678" }, - /*141*/ { "[30]123456789", ZINT_ERROR_INVALID_DATA, "" }, - /*142*/ { "[300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*143*/ { "[3000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*144*/ { "[31]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*145*/ { "[310]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*146*/ { "[3100]123456", 0, "3100123456" }, - /*147*/ { "[3100]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*148*/ { "[3101]123456", 0, "3101123456" }, - /*149*/ { "[3101]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*150*/ { "[3105]123456", 0, "3105123456" }, - /*151*/ { "[3105]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*152*/ { "[3106]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*153*/ { "[3109]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*154*/ { "[3110]123456", 0, "3110123456" }, - /*155*/ { "[3110]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*156*/ { "[3115]123456", 0, "3115123456" }, - /*157*/ { "[3115]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*158*/ { "[3116]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*159*/ { "[3119]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*160*/ { "[3120]123456", 0, "3120123456" }, - /*161*/ { "[3120]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*162*/ { "[3125]123456", 0, "3125123456" }, - /*163*/ { "[3125]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*164*/ { "[3126]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*165*/ { "[3129]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*166*/ { "[3130]123456", 0, "3130123456" }, - /*167*/ { "[3130]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*168*/ { "[3135]123456", 0, "3135123456" }, - /*169*/ { "[3135]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*170*/ { "[3136]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*171*/ { "[3139]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*172*/ { "[3140]123456", 0, "3140123456" }, - /*173*/ { "[3140]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*174*/ { "[3145]123456", 0, "3145123456" }, - /*175*/ { "[3145]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*176*/ { "[3146]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*177*/ { "[3149]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*178*/ { "[3150]123456", 0, "3150123456" }, - /*179*/ { "[3150]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*180*/ { "[3155]123456", 0, "3155123456" }, - /*181*/ { "[3155]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*182*/ { "[3156]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*183*/ { "[3159]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*184*/ { "[3160]123456", 0, "3160123456" }, - /*185*/ { "[3160]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*186*/ { "[3165]123456", 0, "3165123456" }, - /*187*/ { "[3165]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*188*/ { "[3166]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*189*/ { "[3169]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*190*/ { "[3170]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*191*/ { "[3179]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*192*/ { "[3180]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*193*/ { "[3189]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*194*/ { "[3190]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*195*/ { "[3199]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*196*/ { "[32]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*197*/ { "[320]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*198*/ { "[3200]123456", 0, "3200123456" }, - /*199*/ { "[3200]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*200*/ { "[3205]123456", 0, "3205123456" }, - /*201*/ { "[3205]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*202*/ { "[3206]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*203*/ { "[3209]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*204*/ { "[3210]123456", 0, "3210123456" }, - /*205*/ { "[3210]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*206*/ { "[3215]123456", 0, "3215123456" }, - /*207*/ { "[3215]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*208*/ { "[3216]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*209*/ { "[3219]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*210*/ { "[3220]123456", 0, "3220123456" }, - /*211*/ { "[3220]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*212*/ { "[3225]123456", 0, "3225123456" }, - /*213*/ { "[3225]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*214*/ { "[3229]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*215*/ { "[3230]123456", 0, "3230123456" }, - /*216*/ { "[3230]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*217*/ { "[3235]123456", 0, "3235123456" }, - /*218*/ { "[3235]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*219*/ { "[3239]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*220*/ { "[3240]123456", 0, "3240123456" }, - /*221*/ { "[3240]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*222*/ { "[3245]123456", 0, "3245123456" }, - /*223*/ { "[3245]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*224*/ { "[3249]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*225*/ { "[3250]123456", 0, "3250123456" }, - /*226*/ { "[3250]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*227*/ { "[3255]123456", 0, "3255123456" }, - /*228*/ { "[3255]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*229*/ { "[3259]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*230*/ { "[3260]123456", 0, "3260123456" }, - /*231*/ { "[3260]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*232*/ { "[3265]123456", 0, "3265123456" }, - /*233*/ { "[3265]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*234*/ { "[3269]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*235*/ { "[3270]123456", 0, "3270123456" }, - /*236*/ { "[3270]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*237*/ { "[3275]123456", 0, "3275123456" }, - /*238*/ { "[3275]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*239*/ { "[3279]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*240*/ { "[3280]123456", 0, "3280123456" }, - /*241*/ { "[3280]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*242*/ { "[3285]123456", 0, "3285123456" }, - /*243*/ { "[3285]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*244*/ { "[3289]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*245*/ { "[3290]123456", 0, "3290123456" }, - /*246*/ { "[3290]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*247*/ { "[3295]123456", 0, "3295123456" }, - /*248*/ { "[3295]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*249*/ { "[3296]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*250*/ { "[3299]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*251*/ { "[33]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*252*/ { "[330]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*253*/ { "[3300]123456", 0, "3300123456" }, - /*254*/ { "[3300]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*255*/ { "[3305]123456", 0, "3305123456" }, - /*256*/ { "[3305]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*257*/ { "[3306]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*258*/ { "[3309]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*259*/ { "[3310]123456", 0, "3310123456" }, - /*260*/ { "[3310]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*261*/ { "[3319]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*262*/ { "[3320]123456", 0, "3320123456" }, - /*263*/ { "[3320]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*264*/ { "[3329]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*265*/ { "[3330]123456", 0, "3330123456" }, - /*266*/ { "[3330]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*267*/ { "[3339]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*268*/ { "[3340]123456", 0, "3340123456" }, - /*269*/ { "[3340]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*270*/ { "[3349]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*271*/ { "[3350]123456", 0, "3350123456" }, - /*272*/ { "[3350]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*273*/ { "[3359]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*274*/ { "[3360]123456", 0, "3360123456" }, - /*275*/ { "[3360]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*276*/ { "[3369]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*277*/ { "[3370]123456", 0, "3370123456" }, - /*278*/ { "[3370]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*279*/ { "[3375]123456", 0, "3375123456" }, - /*280*/ { "[3375]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*281*/ { "[3376]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*282*/ { "[3379]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*283*/ { "[3380]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*284*/ { "[3390]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*285*/ { "[3399]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*286*/ { "[34]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*287*/ { "[340]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*288*/ { "[3400]123456", 0, "3400123456" }, - /*289*/ { "[3400]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*290*/ { "[3405]123456", 0, "3405123456" }, - /*291*/ { "[3405]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*292*/ { "[3406]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*293*/ { "[3409]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*294*/ { "[3410]123456", 0, "3410123456" }, - /*295*/ { "[3410]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*296*/ { "[3419]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*297*/ { "[3420]123456", 0, "3420123456" }, - /*298*/ { "[3420]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*299*/ { "[3429]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*300*/ { "[3430]123456", 0, "3430123456" }, - /*301*/ { "[3430]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*302*/ { "[3439]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*303*/ { "[3440]123456", 0, "3440123456" }, - /*304*/ { "[3440]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*305*/ { "[3449]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*306*/ { "[3450]123456", 0, "3450123456" }, - /*307*/ { "[3450]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*308*/ { "[3459]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*309*/ { "[3460]123456", 0, "3460123456" }, - /*310*/ { "[3460]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*311*/ { "[3469]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*312*/ { "[3470]123456", 0, "3470123456" }, - /*313*/ { "[3470]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*314*/ { "[3479]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*315*/ { "[3480]123456", 0, "3480123456" }, - /*316*/ { "[3480]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*317*/ { "[3489]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*318*/ { "[3490]123456", 0, "3490123456" }, - /*319*/ { "[3490]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*320*/ { "[3495]123456", 0, "3495123456" }, - /*321*/ { "[3495]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*322*/ { "[3496]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*323*/ { "[3499]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*324*/ { "[35]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*325*/ { "[350]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*326*/ { "[3500]123456", 0, "3500123456" }, - /*327*/ { "[3500]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*328*/ { "[3505]123456", 0, "3505123456" }, - /*329*/ { "[3505]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*330*/ { "[3506]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*331*/ { "[3509]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*332*/ { "[3510]123456", 0, "3510123456", }, - /*333*/ { "[3510]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*334*/ { "[3519]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*335*/ { "[3520]123456", 0, "3520123456", }, - /*336*/ { "[3520]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*337*/ { "[3529]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*338*/ { "[3530]123456", 0, "3530123456", }, - /*339*/ { "[3530]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*340*/ { "[3539]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*341*/ { "[3540]123456", 0, "3540123456", }, - /*342*/ { "[3540]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*343*/ { "[3549]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*344*/ { "[3550]123456", 0, "3550123456", }, - /*345*/ { "[3550]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*346*/ { "[3559]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*347*/ { "[3560]123456", 0, "3560123456", }, - /*348*/ { "[3560]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*349*/ { "[3569]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*350*/ { "[3570]123456", 0, "3570123456", }, - /*351*/ { "[3570]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*352*/ { "[3575]123456", 0, "3575123456" }, - /*353*/ { "[3376]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*354*/ { "[3579]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*355*/ { "[3580]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*356*/ { "[3590]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*357*/ { "[3599]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*358*/ { "[36]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*359*/ { "[360]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*360*/ { "[3600]123456", 0, "3600123456" }, - /*361*/ { "[3600]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*362*/ { "[3605]123456", 0, "3605123456" }, - /*363*/ { "[3605]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*364*/ { "[3606]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*365*/ { "[3609]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*366*/ { "[3610]123456", 0, "3610123456" }, - /*367*/ { "[3610]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*368*/ { "[3619]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*369*/ { "[3620]123456", 0, "3620123456", }, - /*370*/ { "[3620]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*371*/ { "[3629]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*372*/ { "[3630]123456", 0, "3630123456", }, - /*373*/ { "[3630]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*374*/ { "[3639]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*375*/ { "[3640]123456", 0, "3640123456", }, - /*376*/ { "[3640]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*377*/ { "[3649]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*378*/ { "[3650]123456", 0, "3650123456", }, - /*379*/ { "[3650]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*380*/ { "[3659]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*381*/ { "[3660]123456", 0, "3660123456", }, - /*382*/ { "[3660]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*383*/ { "[3669]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*384*/ { "[3670]123456", 0, "3670123456", }, - /*385*/ { "[3670]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*386*/ { "[3679]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*387*/ { "[3680]123456", 0, "3680123456", }, - /*388*/ { "[3680]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*389*/ { "[3689]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*390*/ { "[3690]123456", 0, "3690123456" }, - /*391*/ { "[3690]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*392*/ { "[3695]123456", 0, "3695123456" }, - /*393*/ { "[3695]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*394*/ { "[3696]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*395*/ { "[3699]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*396*/ { "[37]12345678", 0, "3712345678" }, - /*397*/ { "[37]123456789", ZINT_ERROR_INVALID_DATA, "" }, - /*398*/ { "[370]12345678", ZINT_ERROR_INVALID_DATA, "" }, - /*399*/ { "[3700]12345678", ZINT_ERROR_INVALID_DATA, "" }, - /*400*/ { "[38]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*401*/ { "[380]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*402*/ { "[3800]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*403*/ { "[39]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*404*/ { "[390]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*405*/ { "[3900]123456789012345", 0, "3900123456789012345" }, - /*406*/ { "[3900]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*407*/ { "[3900]12345678901234", 0, "390012345678901234" }, - /*408*/ { "[3901]123456789012345", 0, "3901123456789012345" }, - /*409*/ { "[3901]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*410*/ { "[3905]123456789012345", 0, "3905123456789012345" }, - /*411*/ { "[3909]123456789012345", 0, "3909123456789012345" }, - /*412*/ { "[3909]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*413*/ { "[3910]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3910123123456789012345" }, - /*414*/ { "[3910]997123456789012345", 0, "3910997123456789012345" }, - /*415*/ { "[3910]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*416*/ { "[3910]123", ZINT_ERROR_INVALID_DATA, "" }, - /*417*/ { "[3915]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3915123123456789012345" }, - /*418*/ { "[3915]997123456789012345", 0, "3915997123456789012345" }, - /*419*/ { "[3915]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*420*/ { "[3919]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3919123123456789012345" }, - /*421*/ { "[3919]997123456789012345", 0, "3919997123456789012345" }, - /*422*/ { "[3919]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*423*/ { "[3920]123456789012345", 0, "3920123456789012345" }, - /*424*/ { "[3920]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*425*/ { "[3925]123456789012345", 0, "3925123456789012345" }, - /*426*/ { "[3925]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*427*/ { "[3929]123456789012345", 0, "3929123456789012345" }, - /*428*/ { "[3929]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*429*/ { "[3930]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3930123123456789012345" }, - /*430*/ { "[3930]997123456789012345", 0, "3930997123456789012345" }, - /*431*/ { "[3930]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*432*/ { "[3930]123", ZINT_ERROR_INVALID_DATA, "" }, - /*433*/ { "[3935]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3935123123456789012345" }, - /*434*/ { "[3935]997123456789012345", 0, "3935997123456789012345" }, - /*435*/ { "[3935]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*436*/ { "[3939]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3939123123456789012345" }, - /*437*/ { "[3939]997123456789012345", 0, "3939997123456789012345" }, - /*438*/ { "[3939]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*439*/ { "[3940]1234", 0, "39401234" }, - /*440*/ { "[3940]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*441*/ { "[3940]123", ZINT_ERROR_INVALID_DATA, "" }, - /*442*/ { "[3941]1234", 0, "39411234" }, - /*443*/ { "[3941]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*444*/ { "[3941]123", ZINT_ERROR_INVALID_DATA, "" }, - /*445*/ { "[3942]1234", 0, "39421234" }, - /*446*/ { "[3942]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*447*/ { "[3943]1234", 0, "39431234" }, - /*448*/ { "[3943]123", ZINT_ERROR_INVALID_DATA, "" }, - /*449*/ { "[3944]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*450*/ { "[3945]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*451*/ { "[3949]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*452*/ { "[3950]123456", 0, "3950123456" }, - /*453*/ { "[3950]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*454*/ { "[3950]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*455*/ { "[3951]123456", 0, "3951123456" }, - /*456*/ { "[3951]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*457*/ { "[3952]123456", 0, "3952123456" }, - /*458*/ { "[3952]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*459*/ { "[3953]123456", 0, "3953123456" }, - /*460*/ { "[3953]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*461*/ { "[3954]123456", 0, "3954123456" }, - /*462*/ { "[3954]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*463*/ { "[3955]123456", 0, "3955123456" }, - /*464*/ { "[3955]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*465*/ { "[3956]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*466*/ { "[3959]123456", ZINT_ERROR_INVALID_DATA, "" }, - /*467*/ { "[3960]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*468*/ { "[3970]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*469*/ { "[3980]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*470*/ { "[3999]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*471*/ { "[40]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*472*/ { "[400]123456789012345678901234567890", 0, "400123456789012345678901234567890" }, - /*473*/ { "[400]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*474*/ { "[4000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*475*/ { "[401]1234abcdefghijklmnopqrstuvwxyz", 0, "4011234abcdefghijklmnopqrstuvwxyz" }, - /*476*/ { "[401]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" }, - /*477*/ { "[4010]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*478*/ { "[402]13131313131313132", ZINT_WARN_NONCOMPLIANT, "40213131313131313132" }, - /*479*/ { "[402]13131313131313130", 0, "40213131313131313130" }, - /*480*/ { "[402]1313131313131313", ZINT_ERROR_INVALID_DATA, "" }, - /*481*/ { "[4020]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*482*/ { "[403]abcdefghijklmnopqrstuvwxyz1234", 0, "403abcdefghijklmnopqrstuvwxyz1234" }, - /*483*/ { "[403]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*484*/ { "[4030]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*485*/ { "[404]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*486*/ { "[4040]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*487*/ { "[409]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*488*/ { "[4090]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*489*/ { "[41]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*490*/ { "[410]3898765432108", 0, "4103898765432108" }, - /*491*/ { "[410]12345678901234", ZINT_ERROR_INVALID_DATA, "" }, - /*492*/ { "[4100]12345678901234", ZINT_ERROR_INVALID_DATA, "" }, - /*493*/ { "[411]1313131313134", ZINT_WARN_NONCOMPLIANT, "4111313131313134" }, - /*494*/ { "[411]1313131313130", 0, "4111313131313130" }, - /*495*/ { "[411]13131313131", ZINT_ERROR_INVALID_DATA, "" }, - /*496*/ { "[4110]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, - /*497*/ { "[412]1313131313130", 0, "4121313131313130" }, - /*498*/ { "[412]13131313131", ZINT_ERROR_INVALID_DATA, "" }, - /*499*/ { "[4120]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, - /*500*/ { "[413]1313131313130", 0, "4131313131313130" }, - /*501*/ { "[413]13131313131", ZINT_ERROR_INVALID_DATA, "" }, - /*502*/ { "[4130]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, - /*503*/ { "[414]1313131313130", 0, "4141313131313130" }, - /*504*/ { "[414]13131313131", ZINT_ERROR_INVALID_DATA, "" }, - /*505*/ { "[4140]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, - /*506*/ { "[415]1313131313130", 0, "4151313131313130" }, - /*507*/ { "[415]13131313131", ZINT_ERROR_INVALID_DATA, "" }, - /*508*/ { "[4150]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, - /*509*/ { "[416]1313131313130", 0, "4161313131313130" }, - /*510*/ { "[416]13131313131", ZINT_ERROR_INVALID_DATA, "" }, - /*511*/ { "[4160]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, - /*512*/ { "[417]1313131313130", 0, "4171313131313130" }, - /*513*/ { "[417]13131313131", ZINT_ERROR_INVALID_DATA, "" }, - /*514*/ { "[4170]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, - /*515*/ { "[418]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*516*/ { "[4180]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*517*/ { "[419]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*518*/ { "[4190]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*519*/ { "[42]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*520*/ { "[420]abcdefghijklmnopqrst", 0, "420abcdefghijklmnopqrst" }, - /*521*/ { "[420]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*522*/ { "[4200]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*523*/ { "[421]123abcdefghi", ZINT_WARN_NONCOMPLIANT, "421123abcdefghi" }, - /*524*/ { "[421]434abcdefghi", 0, "421434abcdefghi" }, - /*525*/ { "[421]123abcdefghij", ZINT_ERROR_INVALID_DATA, "" }, - /*526*/ { "[421]1231", ZINT_WARN_NONCOMPLIANT, "4211231" }, - /*527*/ { "[421]4341", 0, "4214341" }, - /*528*/ { "[421]123", ZINT_ERROR_INVALID_DATA, "" }, - /*529*/ { "[4210]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*530*/ { "[422]123", ZINT_WARN_NONCOMPLIANT, "422123" }, - /*531*/ { "[422]004", 0, "422004" }, - /*532*/ { "[422]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*533*/ { "[422]12", ZINT_ERROR_INVALID_DATA, "" }, - /*534*/ { "[4220]123", ZINT_ERROR_INVALID_DATA, "" }, - /*535*/ { "[423]123123123123123", ZINT_WARN_NONCOMPLIANT, "423123123123123123" }, - /*536*/ { "[423]470004012887123", ZINT_WARN_NONCOMPLIANT, "423470004012887123" }, - /*537*/ { "[423]470004012887438", 0, "423470004012887438" }, - /*538*/ { "[423]1231231231231231", ZINT_ERROR_INVALID_DATA, "4231231231231231231" }, - /*539*/ { "[423]12312312312312", ZINT_WARN_NONCOMPLIANT, "42312312312312312" }, - /*540*/ { "[423]1231231231231", ZINT_WARN_NONCOMPLIANT, "4231231231231231" }, - /*541*/ { "[423]12312312312", ZINT_WARN_NONCOMPLIANT, "42312312312312" }, - /*542*/ { "[423]1231231231", ZINT_WARN_NONCOMPLIANT, "4231231231231" }, - /*543*/ { "[423]123", ZINT_WARN_NONCOMPLIANT, "423123" }, - /*544*/ { "[423]004", 0, "423004" }, - /*545*/ { "[423]12", ZINT_ERROR_INVALID_DATA, "" }, - /*546*/ { "[4230]123123123123123", ZINT_ERROR_INVALID_DATA, "" }, - /*547*/ { "[424]123", ZINT_WARN_NONCOMPLIANT, "424123" }, - /*548*/ { "[424]004", 0, "424004" }, - /*549*/ { "[424]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*550*/ { "[424]12", ZINT_ERROR_INVALID_DATA, "" }, - /*551*/ { "[4240]123", ZINT_ERROR_INVALID_DATA, "" }, - /*552*/ { "[425]123123123123123", ZINT_WARN_NONCOMPLIANT, "425123123123123123" }, - /*553*/ { "[425]010500276634894", 0, "425010500276634894" }, - /*554*/ { "[425]010500276123894", ZINT_WARN_NONCOMPLIANT, "425010500276123894" }, - /*555*/ { "[425]1231231231231231", ZINT_ERROR_INVALID_DATA, "" }, - /*556*/ { "[425]12", ZINT_ERROR_INVALID_DATA, "" }, - /*557*/ { "[4250]123123123123123", ZINT_ERROR_INVALID_DATA, "" }, - /*558*/ { "[426]123", ZINT_WARN_NONCOMPLIANT, "426123" }, - /*559*/ { "[426]426", 0, "426426" }, - /*560*/ { "[426]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*561*/ { "[426]12", ZINT_ERROR_INVALID_DATA, "" }, - /*562*/ { "[4260]123", ZINT_ERROR_INVALID_DATA, "" }, - /*563*/ { "[427]abc", 0, "427abc" }, - /*564*/ { "[427]abcd", ZINT_ERROR_INVALID_DATA, "" }, - /*565*/ { "[4270]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*566*/ { "[428]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*567*/ { "[4280]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*568*/ { "[429]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*569*/ { "[4290]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*570*/ { "[43]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*571*/ { "[430]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*572*/ { "[4300]1", 0, "43001" }, - /*573*/ { "[4300]12345678901234567890123456789012345", 0, "430012345678901234567890123456789012345" }, - /*574*/ { "[4300]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*575*/ { "[4301]1", 0, "43011" }, - /*576*/ { "[4301]12345678901234567890123456789012345", 0, "430112345678901234567890123456789012345" }, - /*577*/ { "[4301]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*578*/ { "[4302]1", 0, "43021" }, - /*579*/ { "[4302]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43021234567890123456789012345678901234567890123456789012345678901234567890" }, - /*580*/ { "[4302]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*581*/ { "[4303]1", 0, "43031" }, - /*582*/ { "[4303]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43031234567890123456789012345678901234567890123456789012345678901234567890" }, - /*583*/ { "[4303]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*584*/ { "[4304]1", 0, "43041" }, - /*585*/ { "[4304]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43041234567890123456789012345678901234567890123456789012345678901234567890" }, - /*586*/ { "[4304]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*587*/ { "[4305]1", 0, "43051" }, - /*588*/ { "[4305]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43051234567890123456789012345678901234567890123456789012345678901234567890" }, - /*589*/ { "[4305]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*590*/ { "[4306]1", 0, "43061" }, - /*591*/ { "[4306]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43061234567890123456789012345678901234567890123456789012345678901234567890" }, - /*592*/ { "[4306]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*593*/ { "[4307]FR", 0, "4307FR" }, - /*594*/ { "[4307]F", ZINT_ERROR_INVALID_DATA, "" }, - /*595*/ { "[4307]FRR", ZINT_ERROR_INVALID_DATA, "" }, - /*596*/ { "[4308]1", 0, "43081" }, - /*597*/ { "[4308]123456789012345678901234567890", 0, "4308123456789012345678901234567890" }, - /*598*/ { "[4308]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*599*/ { "[4309]1", ZINT_ERROR_INVALID_DATA, "" }, - /*600*/ { "[431]1", ZINT_ERROR_INVALID_DATA, "" }, - /*601*/ { "[4310]1", 0, "43101" }, - /*602*/ { "[4310]12345678901234567890123456789012345", 0, "431012345678901234567890123456789012345" }, - /*603*/ { "[4310]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*604*/ { "[4311]1", 0, "43111" }, - /*605*/ { "[4311]12345678901234567890123456789012345", 0, "431112345678901234567890123456789012345" }, - /*606*/ { "[4311]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*607*/ { "[4312]1", 0, "43121" }, - /*608*/ { "[4312]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43121234567890123456789012345678901234567890123456789012345678901234567890" }, - /*609*/ { "[4312]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*610*/ { "[4313]1", 0, "43131" }, - /*611*/ { "[4313]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43131234567890123456789012345678901234567890123456789012345678901234567890" }, - /*612*/ { "[4313]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*613*/ { "[4314]1", 0, "43141" }, - /*614*/ { "[4314]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43141234567890123456789012345678901234567890123456789012345678901234567890" }, - /*615*/ { "[4314]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*616*/ { "[4315]1", 0, "43151" }, - /*617*/ { "[4315]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43151234567890123456789012345678901234567890123456789012345678901234567890" }, - /*618*/ { "[4315]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*619*/ { "[4316]1", 0, "43161" }, - /*620*/ { "[4316]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43161234567890123456789012345678901234567890123456789012345678901234567890" }, - /*621*/ { "[4316]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*622*/ { "[4317]FR", 0, "4317FR" }, - /*623*/ { "[4317]F", ZINT_ERROR_INVALID_DATA, "" }, - /*624*/ { "[4317]FRF", ZINT_ERROR_INVALID_DATA, "" }, - /*625*/ { "[4318]1", 0, "43181" }, - /*626*/ { "[4318]12345678901234567890", 0, "431812345678901234567890" }, - /*627*/ { "[4318]123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*628*/ { "[4319]1", 0, "43191" }, - /*629*/ { "[4319]123456789012345678901234567890", 0, "4319123456789012345678901234567890" }, - /*630*/ { "[4319]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*631*/ { "[432]1", ZINT_ERROR_INVALID_DATA, "" }, - /*632*/ { "[4320]1", 0, "43201" }, - /*633*/ { "[4320]12345678901234567890123456789012345", 0, "432012345678901234567890123456789012345" }, - /*634*/ { "[4320]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*635*/ { "[4321]1", 0, "43211" }, - /*636*/ { "[4321]10", ZINT_ERROR_INVALID_DATA, "" }, - /*637*/ { "[4322]1", 0, "43221" }, - /*638*/ { "[4322]10", ZINT_ERROR_INVALID_DATA, "" }, - /*639*/ { "[4323]1", 0, "43231" }, - /*640*/ { "[4323]10", ZINT_ERROR_INVALID_DATA, "" }, - /*641*/ { "[4324]1212120000", 0, "43241212120000" }, - /*642*/ { "[4324]121212000", ZINT_ERROR_INVALID_DATA, "" }, - /*643*/ { "[4324]12121200000", ZINT_ERROR_INVALID_DATA, "" }, - /*644*/ { "[4325]1212120000", 0, "43251212120000" }, - /*645*/ { "[4325]121212000", ZINT_ERROR_INVALID_DATA, "" }, - /*646*/ { "[4325]12121200000", ZINT_ERROR_INVALID_DATA, "" }, - /*647*/ { "[4326]121212", 0, "4326121212" }, - /*648*/ { "[4326]12121", ZINT_ERROR_INVALID_DATA, "" }, - /*649*/ { "[4326]1212120", ZINT_ERROR_INVALID_DATA, "" }, - /*650*/ { "[4327]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*651*/ { "[4328]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*652*/ { "[4329]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*653*/ { "[433]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*654*/ { "[4330]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*655*/ { "[44]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*656*/ { "[440]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*657*/ { "[4400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*658*/ { "[49]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*659*/ { "[490]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*660*/ { "[4900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*661*/ { "[499]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*662*/ { "[4990]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*663*/ { "[50]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*664*/ { "[500]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*665*/ { "[5000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*666*/ { "[51]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*667*/ { "[510]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*668*/ { "[5100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*669*/ { "[59]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*670*/ { "[590]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*671*/ { "[5900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*672*/ { "[60]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*673*/ { "[600]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*674*/ { "[6000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*675*/ { "[61]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*676*/ { "[610]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*677*/ { "[6100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*678*/ { "[69]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*679*/ { "[690]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*680*/ { "[6900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*681*/ { "[70]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*682*/ { "[700]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*683*/ { "[7000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*684*/ { "[7001]1234567890123", 0, "70011234567890123" }, - /*685*/ { "[7001]123456789012", ZINT_ERROR_INVALID_DATA, "" }, - /*686*/ { "[7002]abcdefghijklmnopqrstuvwxyz1234", 0, "7002abcdefghijklmnopqrstuvwxyz1234" }, - /*687*/ { "[7002]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*688*/ { "[7003]1212121212", 0, "70031212121212" }, - /*689*/ { "[7003]121212121", ZINT_ERROR_INVALID_DATA, "" }, - /*690*/ { "[7004]1234", 0, "70041234" }, - /*691*/ { "[7004]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*692*/ { "[7005]abcdefghijkl", 0, "7005abcdefghijkl" }, - /*693*/ { "[7005]abcdefghijklm", ZINT_ERROR_INVALID_DATA, "" }, - /*694*/ { "[7006]200132", ZINT_WARN_NONCOMPLIANT, "7006200132" }, - /*695*/ { "[7006]200100", ZINT_WARN_NONCOMPLIANT, "7006200100" }, - /*696*/ { "[7006]200120", 0, "7006200120" }, - /*697*/ { "[7006]2001320", ZINT_ERROR_INVALID_DATA, "" }, - /*698*/ { "[7007]010101121212", 0, "7007010101121212" }, - /*699*/ { "[7007]01010112121", ZINT_ERROR_INVALID_DATA, "" }, - /*700*/ { "[7007]A1010112121", ZINT_ERROR_INVALID_DATA, "" }, - /*701*/ { "[7007]121212", 0, "7007121212" }, - /*702*/ { "[7007]12121", ZINT_ERROR_INVALID_DATA, "" }, - /*703*/ { "[7007]1212121", ZINT_ERROR_INVALID_DATA, "" }, - /*704*/ { "[7008]abc", 0, "7008abc" }, - /*705*/ { "[7008]abcd", ZINT_ERROR_INVALID_DATA, "" }, - /*706*/ { "[7009]abcdefghij", 0, "7009abcdefghij" }, - /*707*/ { "[7009]abcdefghijk", ZINT_ERROR_INVALID_DATA, "" }, - /*708*/ { "[7010]01", 0, "701001" }, - /*709*/ { "[7010]1", 0, "70101" }, - /*710*/ { "[7010]012", ZINT_ERROR_INVALID_DATA, "" }, - /*711*/ { "[7011]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*712*/ { "[7012]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*713*/ { "[7019]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*714*/ { "[7020]abcdefghijklmnopqrst", 0, "7020abcdefghijklmnopqrst" }, - /*715*/ { "[7020]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*716*/ { "[7021]abcdefghijklmnopqrst", 0, "7021abcdefghijklmnopqrst" }, - /*717*/ { "[7021]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*718*/ { "[7022]abcdefghijklmnopqrst", 0, "7022abcdefghijklmnopqrst" }, - /*719*/ { "[7022]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*720*/ { "[7023]1234abcdefghijklmnopqrstuvwxyz", 0, "70231234abcdefghijklmnopqrstuvwxyz" }, - /*721*/ { "[7023]1234abcdefghijklmnopqrstuvwxyza", ZINT_ERROR_INVALID_DATA, "" }, - /*722*/ { "[7024]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*723*/ { "[7025]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*724*/ { "[7029]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*725*/ { "[7030]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7030123abcdefghijklmnopqrstuvwxyza" }, - /*726*/ { "[7030]004abcdefghijklmnopqrstuvwxyza", 0, "7030004abcdefghijklmnopqrstuvwxyza" }, - /*727*/ { "[7030]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*728*/ { "[7031]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7031123abcdefghijklmnopqrstuvwxyza" }, - /*729*/ { "[7031]004abcdefghijklmnopqrstuvwxyza", 0, "7031004abcdefghijklmnopqrstuvwxyza" }, - /*730*/ { "[7031]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*731*/ { "[7032]004abcdefghijklmnopqrstuvwxyza", 0, "7032004abcdefghijklmnopqrstuvwxyza" }, - /*732*/ { "[7032]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*733*/ { "[7033]004abcdefghijklmnopqrstuvwxyza", 0, "7033004abcdefghijklmnopqrstuvwxyza" }, - /*734*/ { "[7033]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*735*/ { "[7034]004abcdefghijklmnopqrstuvwxyza", 0, "7034004abcdefghijklmnopqrstuvwxyza" }, - /*736*/ { "[7034]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*737*/ { "[7035]004abcdefghijklmnopqrstuvwxyza", 0, "7035004abcdefghijklmnopqrstuvwxyza" }, - /*738*/ { "[7035]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*739*/ { "[7036]004abcdefghijklmnopqrstuvwxyza", 0, "7036004abcdefghijklmnopqrstuvwxyza" }, - /*740*/ { "[7036]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*741*/ { "[7037]004abcdefghijklmnopqrstuvwxyza", 0, "7037004abcdefghijklmnopqrstuvwxyza" }, - /*742*/ { "[7037]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*743*/ { "[7038]004abcdefghijklmnopqrstuvwxyza", 0, "7038004abcdefghijklmnopqrstuvwxyza" }, - /*744*/ { "[7038]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*745*/ { "[7039]004abcdefghijklmnopqrstuvwxyza", 0, "7039004abcdefghijklmnopqrstuvwxyza" }, - /*746*/ { "[7039]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*747*/ { "[7040]1abc", 0, "70401abc" }, - /*748*/ { "[7040]1ab", ZINT_ERROR_INVALID_DATA, "" }, - /*749*/ { "[7040]1abcd", ZINT_ERROR_INVALID_DATA, "" }, - /*750*/ { "[7041]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*751*/ { "[7042]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*752*/ { "[7050]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*753*/ { "[7090]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*754*/ { "[7099]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*755*/ { "[71]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*756*/ { "[710]abcdefghijklmnopqrst", 0, "710abcdefghijklmnopqrst" }, - /*757*/ { "[710]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*758*/ { "[7100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*759*/ { "[711]abcdefghijklmnopqrst", 0, "711abcdefghijklmnopqrst" }, - /*760*/ { "[711]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*761*/ { "[712]abcdefghijklmnopqrst", 0, "712abcdefghijklmnopqrst" }, - /*762*/ { "[712]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*763*/ { "[713]abcdefghijklmnopqrst", 0, "713abcdefghijklmnopqrst" }, - /*764*/ { "[713]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*765*/ { "[714]abcdefghijklmnopqrst", 0, "714abcdefghijklmnopqrst" }, - /*766*/ { "[714]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*767*/ { "[715]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*768*/ { "[716]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*769*/ { "[719]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*770*/ { "[72]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*771*/ { "[720]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*772*/ { "[7200]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*773*/ { "[721]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*774*/ { "[7210]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*775*/ { "[7220]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*776*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzab", 0, "7230EMabcdefghijklmnopqrstuvwxyzab" }, - /*777*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*778*/ { "[7230]EM", ZINT_ERROR_INVALID_DATA, "" }, - /*779*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzab", 0, "7231EMabcdefghijklmnopqrstuvwxyzab" }, - /*780*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*781*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzab", 0, "7232EMabcdefghijklmnopqrstuvwxyzab" }, - /*782*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*783*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzab", 0, "7233EMabcdefghijklmnopqrstuvwxyzab" }, - /*784*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*785*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzab", 0, "7234EMabcdefghijklmnopqrstuvwxyzab" }, - /*786*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*787*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzab", 0, "7235EMabcdefghijklmnopqrstuvwxyzab" }, - /*788*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*789*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzab", 0, "7236EMabcdefghijklmnopqrstuvwxyzab" }, - /*790*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*791*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzab", 0, "7237EMabcdefghijklmnopqrstuvwxyzab" }, - /*792*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*793*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzab", 0, "7238EMabcdefghijklmnopqrstuvwxyzab" }, - /*794*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*795*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzab", 0, "7239EMabcdefghijklmnopqrstuvwxyzab" }, - /*796*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*797*/ { "[7239]E", ZINT_ERROR_INVALID_DATA, "" }, - /*798*/ { "[7240]abcdefghijklmnopqrst", 0, "7240abcdefghijklmnopqrst" }, - /*799*/ { "[7240]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*800*/ { "[7241]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*801*/ { "[7249]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*802*/ { "[7250]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*803*/ { "[7299]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*804*/ { "[73]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*805*/ { "[7300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*806*/ { "[74]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*807*/ { "[7400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*808*/ { "[79]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*809*/ { "[7900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*810*/ { "[7999]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*811*/ { "[80]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*812*/ { "[800]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*813*/ { "[8000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*814*/ { "[8001]12345678901234", ZINT_WARN_NONCOMPLIANT, "800112345678901234" }, - /*815*/ { "[8001]12345678901204", 0, "800112345678901204" }, - /*816*/ { "[8001]1234123456789012345", ZINT_ERROR_INVALID_DATA, "" }, - /*817*/ { "[8002]abcdefghijklmnopqrst", 0, "8002abcdefghijklmnopqrst" }, - /*818*/ { "[8002]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*819*/ { "[8003]01234567890123abcdefghijklmnop", ZINT_WARN_NONCOMPLIANT, "800301234567890123abcdefghijklmnop" }, - /*820*/ { "[8003]01234567890128abcdefghijklmnop", 0, "800301234567890128abcdefghijklmnop" }, - /*821*/ { "[8003]01234567890128abcdefghijklmnopq", ZINT_ERROR_INVALID_DATA, "" }, - /*822*/ { "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_WARN_NONCOMPLIANT, "8004abcdefghijklmnopqrstuvwxyz1234" }, - /*823*/ { "[8004]12cdefghijklmnopqrstuvwxyz1234", 0, "800412cdefghijklmnopqrstuvwxyz1234" }, - /*824*/ { "[8004]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*825*/ { "[8005]123456", 0, "8005123456" }, - /*826*/ { "[8005]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*827*/ { "[8005]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*828*/ { "[8006]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8006123456789012341212" }, - /*829*/ { "[8006]123456789012311212", 0, "8006123456789012311212" }, - /*830*/ { "[8006]12345678901234121", ZINT_ERROR_INVALID_DATA, "" }, - /*831*/ { "[8006]1234567890123412123", ZINT_ERROR_INVALID_DATA, "" }, - /*832*/ { "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_WARN_NONCOMPLIANT, "8007abcdefghijklmnopqrstuvwxyz12345678" }, - /*833*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678" }, - /*834*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ123456789", ZINT_ERROR_INVALID_DATA, "" }, - /*835*/ { "[8008]123456121212", ZINT_WARN_NONCOMPLIANT, "8008123456121212" }, - /*836*/ { "[8008]121256121212", ZINT_WARN_NONCOMPLIANT, "8008121256121212" }, - /*837*/ { "[8008]121231121212", 0, "8008121231121212" }, - /*838*/ { "[8008]1234561212", ZINT_WARN_NONCOMPLIANT, "80081234561212" }, - /*839*/ { "[8008]1212311212", 0, "80081212311212" }, - /*840*/ { "[8008]12345612", ZINT_WARN_NONCOMPLIANT, "800812345612" }, - /*841*/ { "[8008]12010112", 0, "800812010112" }, - /*842*/ { "[8008]1234561", ZINT_ERROR_INVALID_DATA, "" }, - /*843*/ { "[8008]123456121", ZINT_ERROR_INVALID_DATA, "" }, - /*844*/ { "[8008]12345612121", ZINT_ERROR_INVALID_DATA, "" }, - /*845*/ { "[8008]1234561212123", ZINT_ERROR_INVALID_DATA, "" }, - /*846*/ { "[8009]12345678901234567890123456789012345678901234567890", 0, "800912345678901234567890123456789012345678901234567890" }, - /*847*/ { "[8009]123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*848*/ { "[8010]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" }, - /*849*/ { "[8011]123456789012", 0, "8011123456789012" }, - /*850*/ { "[8011]1234567890123", ZINT_ERROR_INVALID_DATA, "" }, - /*851*/ { "[8012]abcdefghijklmnopqrst", 0, "8012abcdefghijklmnopqrst" }, - /*852*/ { "[8012]abcdefghijklmnopqrstuv", ZINT_ERROR_INVALID_DATA, "" }, - /*853*/ { "[8013]1234abcdefghijklmnopqrstuvwxyz", 0, "80131234abcdefghijklmnopqrstuvwxyz" }, - /*854*/ { "[8013]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" }, - /*855*/ { "[8014]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*856*/ { "[8016]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*857*/ { "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139" }, - /*858*/ { "[8017]313131313131313131", 0, "8017313131313131313131" }, - /*859*/ { "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, - /*860*/ { "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, - /*861*/ { "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139" }, - /*862*/ { "[8018]313131313131313131", 0, "8018313131313131313131" }, - /*863*/ { "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, - /*864*/ { "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, - /*865*/ { "[8019]1234567890", 0, "80191234567890" }, - /*866*/ { "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*867*/ { "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy" }, - /*868*/ { "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "" }, - /*869*/ { "[8021]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*870*/ { "[8025]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*871*/ { "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212" }, - /*872*/ { "[8026]123456789012311212", 0, "8026123456789012311212" }, - /*873*/ { "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "" }, - /*874*/ { "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "" }, - /*875*/ { "[8027]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*876*/ { "[8030]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*877*/ { "[8040]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*878*/ { "[8050]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*879*/ { "[8060]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*880*/ { "[8070]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*881*/ { "[8080]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*882*/ { "[8090]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*883*/ { "[8099]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*884*/ { "[81]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*885*/ { "[8100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*886*/ { "[8109]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*887*/ { "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000" }, - /*888*/ { "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "" }, - /*889*/ { "[8111]1234", 0, "81111234" }, - /*890*/ { "[8111]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*891*/ { "[8111]123", ZINT_ERROR_INVALID_DATA, "" }, - /*892*/ { "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890" }, - /*893*/ { "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*894*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345" }, - /*895*/ { "[8113]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*896*/ { "[8120]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*897*/ { "[8130]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*898*/ { "[8140]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*899*/ { "[8150]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*900*/ { "[8190]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*901*/ { "[8199]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*902*/ { "[82]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*903*/ { "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890" }, - /*904*/ { "[8201]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*905*/ { "[8210]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*906*/ { "[8220]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*907*/ { "[8230]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*908*/ { "[8240]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*909*/ { "[8250]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*910*/ { "[8290]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*911*/ { "[8299]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*912*/ { "[83]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*913*/ { "[830]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*914*/ { "[8300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*915*/ { "[84]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*916*/ { "[840]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*917*/ { "[8400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*918*/ { "[85]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*919*/ { "[850]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*920*/ { "[8500]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*921*/ { "[89]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*922*/ { "[890]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*923*/ { "[8900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*924*/ { "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234" }, - /*925*/ { "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*926*/ { "[900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*927*/ { "[9000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*928*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*929*/ { "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*930*/ { "[910]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*931*/ { "[9100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*932*/ { "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*933*/ { "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*934*/ { "[920]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*935*/ { "[9200]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*936*/ { "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*937*/ { "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*938*/ { "[930]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*939*/ { "[9300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*940*/ { "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*941*/ { "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*942*/ { "[940]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*943*/ { "[9400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*944*/ { "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*945*/ { "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*946*/ { "[950]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*947*/ { "[9500]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*948*/ { "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*949*/ { "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*950*/ { "[960]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*951*/ { "[9600]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*952*/ { "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*953*/ { "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*954*/ { "[970]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*955*/ { "[9700]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*956*/ { "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*957*/ { "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*958*/ { "[980]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*959*/ { "[9800]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*960*/ { "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*961*/ { "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*962*/ { "[990]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*963*/ { "[9900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*964*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*965*/ { "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101" }, - /*966*/ { "[01]12345678901231[7006]200101", 0, "01123456789012317006200101" }, - /*967*/ { "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890[0112345678901234" }, - /*968*/ { "[3900]1234567890[01]12345678901231", 0, "39001234567890[0112345678901231" }, - /*969*/ { "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[390112345678901234[2012" }, - /*970*/ { "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284[390112345678901234[2012" }, - /*971*/ { "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[0112345678901234390112345678901234[2012" }, - /*972*/ { "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284[0112345678901231390112345678901234[2012" }, + /* 12*/ { "[00]376104250021234569", 0, "00376104250021234569" }, + /* 13*/ { "[00]376104250021234568", ZINT_WARN_NONCOMPLIANT, "00376104250021234568" }, + /* 14*/ { "[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "0112345678901234" }, + /* 15*/ { "[01]12345678901231", 0, "0112345678901231" }, + /* 16*/ { "[01]123456789012345", ZINT_ERROR_INVALID_DATA, "" }, + /* 17*/ { "[02]12345678901234", ZINT_WARN_NONCOMPLIANT, "0212345678901234" }, + /* 18*/ { "[02]12345678901231", 0, "0212345678901231" }, + /* 19*/ { "[02]1234567890123", ZINT_ERROR_INVALID_DATA, "" }, + /* 20*/ { "[03]12345678901234", ZINT_ERROR_INVALID_DATA, "" }, + /* 21*/ { "[04]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 22*/ { "[05]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 23*/ { "[06]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 24*/ { "[07]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 25*/ { "[08]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 26*/ { "[09]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 27*/ { "[10]ABCD123456", 0, "10ABCD123456" }, + /* 28*/ { "[10]123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /* 29*/ { "[100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 30*/ { "[1000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 31*/ { "[11]990102", 0, "11990102" }, + /* 32*/ { "[11]9901023", ZINT_ERROR_INVALID_DATA, "" }, + /* 33*/ { "[110]990102", ZINT_ERROR_INVALID_DATA, "" }, + /* 34*/ { "[1100]990102", ZINT_ERROR_INVALID_DATA, "" }, + /* 35*/ { "[12]000100", 0, "12000100" }, + /* 36*/ { "[12]00010", ZINT_ERROR_INVALID_DATA, "" }, + /* 37*/ { "[120]000100", ZINT_ERROR_INVALID_DATA, "" }, + /* 38*/ { "[1200]000100", ZINT_ERROR_INVALID_DATA, "" }, + /* 39*/ { "[13]991301", ZINT_WARN_NONCOMPLIANT, "13991301" }, + /* 40*/ { "[13]991201", 0, "13991201" }, + /* 41*/ { "[13]9913011", ZINT_ERROR_INVALID_DATA, "" }, + /* 42*/ { "[130]991301", ZINT_ERROR_INVALID_DATA, "" }, + /* 43*/ { "[1300]991301", ZINT_ERROR_INVALID_DATA, "" }, + /* 44*/ { "[14]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 45*/ { "[140]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 46*/ { "[1400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 47*/ { "[15]021231", 0, "15021231" }, + /* 48*/ { "[15]02123", ZINT_ERROR_INVALID_DATA, "" }, + /* 49*/ { "[150]021231", ZINT_ERROR_INVALID_DATA, "" }, + /* 50*/ { "[1500]021231", ZINT_ERROR_INVALID_DATA, "" }, + /* 51*/ { "[16]000000", ZINT_WARN_NONCOMPLIANT, "16000000" }, + /* 52*/ { "[16]000100", 0, "16000100" }, + /* 53*/ { "[16]00000", ZINT_ERROR_INVALID_DATA, "" }, + /* 54*/ { "[160]000000", ZINT_ERROR_INVALID_DATA, "" }, + /* 55*/ { "[1600]000000", ZINT_ERROR_INVALID_DATA, "" }, + /* 56*/ { "[17]010200", 0, "17010200" }, + /* 57*/ { "[17]0102000", ZINT_ERROR_INVALID_DATA, "" }, + /* 58*/ { "[170]010200", ZINT_ERROR_INVALID_DATA, "" }, + /* 59*/ { "[1700]010200", ZINT_ERROR_INVALID_DATA, "" }, + /* 60*/ { "[18]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 61*/ { "[180]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 62*/ { "[1800]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 63*/ { "[19]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 64*/ { "[190]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 65*/ { "[1900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 66*/ { "[20]12", 0, "2012" }, + /* 67*/ { "[20]1", ZINT_ERROR_INVALID_DATA, "" }, + /* 68*/ { "[200]12", ZINT_ERROR_INVALID_DATA, "" }, + /* 69*/ { "[2000]12", ZINT_ERROR_INVALID_DATA, "" }, + /* 70*/ { "[21]A12345678", 0, "21A12345678" }, + /* 71*/ { "[21]123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /* 72*/ { "[210]A12345678", ZINT_ERROR_INVALID_DATA, "" }, + /* 73*/ { "[2100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 74*/ { "[22]abcdefghijklmnopqrst", 0, "22abcdefghijklmnopqrst" }, + /* 75*/ { "[22]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /* 76*/ { "[220]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 77*/ { "[2200]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 78*/ { "[23]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 79*/ { "[230]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 80*/ { "[2300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 81*/ { "[235]1abcdefghijklmnopqrstuvwxyz0", 0, "2351abcdefghijklmnopqrstuvwxyz0" }, + /* 82*/ { "[235]1abcdefghijklmnopqrstuvwxyz01", ZINT_ERROR_INVALID_DATA, "" }, + /* 83*/ { "[24]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 84*/ { "[240]abcdefghijklmnopqrstuvwxyz1234", 0, "240abcdefghijklmnopqrstuvwxyz1234" }, + /* 85*/ { "[240]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /* 86*/ { "[2400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 87*/ { "[241]abcdefghijklmnopqrstuvwxyz1234", 0, "241abcdefghijklmnopqrstuvwxyz1234" }, + /* 88*/ { "[241]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /* 89*/ { "[2410]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 90*/ { "[242]12345", 0, "24212345" }, + /* 91*/ { "[242]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /* 92*/ { "[2420]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 93*/ { "[243]abcdefghijklmnopqrst", 0, "243abcdefghijklmnopqrst" }, + /* 94*/ { "[243]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /* 95*/ { "[2430]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 96*/ { "[244]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 97*/ { "[2440]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 98*/ { "[249]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 99*/ { "[2490]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*100*/ { "[25]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*101*/ { "[250]abcdefghijklmnopqrstuvwxyz1234", 0, "250abcdefghijklmnopqrstuvwxyz1234" }, + /*102*/ { "[250]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*103*/ { "[2500]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*104*/ { "[251]abcdefghijklmnopqrstuvwxyz1234", 0, "251abcdefghijklmnopqrstuvwxyz1234" }, + /*105*/ { "[251]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*106*/ { "[2510]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*107*/ { "[252]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*108*/ { "[2520]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*109*/ { "[253]131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /*110*/ { "[253]1313131313134", ZINT_WARN_NONCOMPLIANT, "2531313131313134" }, + /*111*/ { "[253]1313131313130", 0, "2531313131313130" }, + /*112*/ { "[253]131313131313412345678901234567", ZINT_WARN_NONCOMPLIANT, "253131313131313412345678901234567" }, + /*113*/ { "[253]131313131313012345678901234567", 0, "253131313131313012345678901234567" }, + /*114*/ { "[253]1313131313134123456789012345678", ZINT_ERROR_INVALID_DATA, "" }, + /*115*/ { "[2530]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*116*/ { "[254]abcdefghijklmnopqrst", 0, "254abcdefghijklmnopqrst" }, + /*117*/ { "[254]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*118*/ { "[2540]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*119*/ { "[255]131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /*120*/ { "[255]1313131313134", ZINT_WARN_NONCOMPLIANT, "2551313131313134" }, + /*121*/ { "[255]1313131313130", 0, "2551313131313130" }, + /*122*/ { "[255]1313131313134123456789012", ZINT_WARN_NONCOMPLIANT, "2551313131313134123456789012" }, + /*123*/ { "[255]1313131313130123456789012", 0, "2551313131313130123456789012" }, + /*124*/ { "[255]13131313131341234567890123", ZINT_ERROR_INVALID_DATA, "" }, + /*125*/ { "[2550]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*126*/ { "[256]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*127*/ { "[2560]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*128*/ { "[259]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*129*/ { "[2590]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*130*/ { "[26]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*131*/ { "[260]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*132*/ { "[2600]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*133*/ { "[27]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*134*/ { "[270]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*135*/ { "[2700]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*136*/ { "[28]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*137*/ { "[280]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*138*/ { "[2800]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*139*/ { "[29]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*140*/ { "[290]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*141*/ { "[2900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*142*/ { "[30]12345678", 0, "3012345678" }, + /*143*/ { "[30]123456789", ZINT_ERROR_INVALID_DATA, "" }, + /*144*/ { "[300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*145*/ { "[3000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*146*/ { "[31]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*147*/ { "[310]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*148*/ { "[3100]123456", 0, "3100123456" }, + /*149*/ { "[3100]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*150*/ { "[3101]123456", 0, "3101123456" }, + /*151*/ { "[3101]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*152*/ { "[3105]123456", 0, "3105123456" }, + /*153*/ { "[3105]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*154*/ { "[3106]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*155*/ { "[3109]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*156*/ { "[3110]123456", 0, "3110123456" }, + /*157*/ { "[3110]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*158*/ { "[3115]123456", 0, "3115123456" }, + /*159*/ { "[3115]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*160*/ { "[3116]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*161*/ { "[3119]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*162*/ { "[3120]123456", 0, "3120123456" }, + /*163*/ { "[3120]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*164*/ { "[3125]123456", 0, "3125123456" }, + /*165*/ { "[3125]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*166*/ { "[3126]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*167*/ { "[3129]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*168*/ { "[3130]123456", 0, "3130123456" }, + /*169*/ { "[3130]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*170*/ { "[3135]123456", 0, "3135123456" }, + /*171*/ { "[3135]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*172*/ { "[3136]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*173*/ { "[3139]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*174*/ { "[3140]123456", 0, "3140123456" }, + /*175*/ { "[3140]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*176*/ { "[3145]123456", 0, "3145123456" }, + /*177*/ { "[3145]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*178*/ { "[3146]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*179*/ { "[3149]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*180*/ { "[3150]123456", 0, "3150123456" }, + /*181*/ { "[3150]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*182*/ { "[3155]123456", 0, "3155123456" }, + /*183*/ { "[3155]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*184*/ { "[3156]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*185*/ { "[3159]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*186*/ { "[3160]123456", 0, "3160123456" }, + /*187*/ { "[3160]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*188*/ { "[3165]123456", 0, "3165123456" }, + /*189*/ { "[3165]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*190*/ { "[3166]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*191*/ { "[3169]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*192*/ { "[3170]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*193*/ { "[3179]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*194*/ { "[3180]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*195*/ { "[3189]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*196*/ { "[3190]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*197*/ { "[3199]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*198*/ { "[32]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*199*/ { "[320]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*200*/ { "[3200]123456", 0, "3200123456" }, + /*201*/ { "[3200]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*202*/ { "[3205]123456", 0, "3205123456" }, + /*203*/ { "[3205]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*204*/ { "[3206]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*205*/ { "[3209]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*206*/ { "[3210]123456", 0, "3210123456" }, + /*207*/ { "[3210]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*208*/ { "[3215]123456", 0, "3215123456" }, + /*209*/ { "[3215]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*210*/ { "[3216]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*211*/ { "[3219]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*212*/ { "[3220]123456", 0, "3220123456" }, + /*213*/ { "[3220]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*214*/ { "[3225]123456", 0, "3225123456" }, + /*215*/ { "[3225]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*216*/ { "[3229]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*217*/ { "[3230]123456", 0, "3230123456" }, + /*218*/ { "[3230]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*219*/ { "[3235]123456", 0, "3235123456" }, + /*220*/ { "[3235]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*221*/ { "[3239]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*222*/ { "[3240]123456", 0, "3240123456" }, + /*223*/ { "[3240]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*224*/ { "[3245]123456", 0, "3245123456" }, + /*225*/ { "[3245]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*226*/ { "[3249]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*227*/ { "[3250]123456", 0, "3250123456" }, + /*228*/ { "[3250]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*229*/ { "[3255]123456", 0, "3255123456" }, + /*230*/ { "[3255]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*231*/ { "[3259]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*232*/ { "[3260]123456", 0, "3260123456" }, + /*233*/ { "[3260]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*234*/ { "[3265]123456", 0, "3265123456" }, + /*235*/ { "[3265]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*236*/ { "[3269]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*237*/ { "[3270]123456", 0, "3270123456" }, + /*238*/ { "[3270]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*239*/ { "[3275]123456", 0, "3275123456" }, + /*240*/ { "[3275]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*241*/ { "[3279]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*242*/ { "[3280]123456", 0, "3280123456" }, + /*243*/ { "[3280]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*244*/ { "[3285]123456", 0, "3285123456" }, + /*245*/ { "[3285]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*246*/ { "[3289]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*247*/ { "[3290]123456", 0, "3290123456" }, + /*248*/ { "[3290]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*249*/ { "[3295]123456", 0, "3295123456" }, + /*250*/ { "[3295]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*251*/ { "[3296]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*252*/ { "[3299]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*253*/ { "[33]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*254*/ { "[330]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*255*/ { "[3300]123456", 0, "3300123456" }, + /*256*/ { "[3300]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*257*/ { "[3305]123456", 0, "3305123456" }, + /*258*/ { "[3305]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*259*/ { "[3306]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*260*/ { "[3309]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*261*/ { "[3310]123456", 0, "3310123456" }, + /*262*/ { "[3310]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*263*/ { "[3319]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*264*/ { "[3320]123456", 0, "3320123456" }, + /*265*/ { "[3320]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*266*/ { "[3329]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*267*/ { "[3330]123456", 0, "3330123456" }, + /*268*/ { "[3330]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*269*/ { "[3339]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*270*/ { "[3340]123456", 0, "3340123456" }, + /*271*/ { "[3340]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*272*/ { "[3349]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*273*/ { "[3350]123456", 0, "3350123456" }, + /*274*/ { "[3350]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*275*/ { "[3359]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*276*/ { "[3360]123456", 0, "3360123456" }, + /*277*/ { "[3360]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*278*/ { "[3369]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*279*/ { "[3370]123456", 0, "3370123456" }, + /*280*/ { "[3370]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*281*/ { "[3375]123456", 0, "3375123456" }, + /*282*/ { "[3375]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*283*/ { "[3376]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*284*/ { "[3379]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*285*/ { "[3380]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*286*/ { "[3390]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*287*/ { "[3399]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*288*/ { "[34]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*289*/ { "[340]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*290*/ { "[3400]123456", 0, "3400123456" }, + /*291*/ { "[3400]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*292*/ { "[3405]123456", 0, "3405123456" }, + /*293*/ { "[3405]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*294*/ { "[3406]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*295*/ { "[3409]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*296*/ { "[3410]123456", 0, "3410123456" }, + /*297*/ { "[3410]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*298*/ { "[3419]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*299*/ { "[3420]123456", 0, "3420123456" }, + /*300*/ { "[3420]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*301*/ { "[3429]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*302*/ { "[3430]123456", 0, "3430123456" }, + /*303*/ { "[3430]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*304*/ { "[3439]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*305*/ { "[3440]123456", 0, "3440123456" }, + /*306*/ { "[3440]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*307*/ { "[3449]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*308*/ { "[3450]123456", 0, "3450123456" }, + /*309*/ { "[3450]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*310*/ { "[3459]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*311*/ { "[3460]123456", 0, "3460123456" }, + /*312*/ { "[3460]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*313*/ { "[3469]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*314*/ { "[3470]123456", 0, "3470123456" }, + /*315*/ { "[3470]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*316*/ { "[3479]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*317*/ { "[3480]123456", 0, "3480123456" }, + /*318*/ { "[3480]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*319*/ { "[3489]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*320*/ { "[3490]123456", 0, "3490123456" }, + /*321*/ { "[3490]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*322*/ { "[3495]123456", 0, "3495123456" }, + /*323*/ { "[3495]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*324*/ { "[3496]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*325*/ { "[3499]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*326*/ { "[35]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*327*/ { "[350]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*328*/ { "[3500]123456", 0, "3500123456" }, + /*329*/ { "[3500]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*330*/ { "[3505]123456", 0, "3505123456" }, + /*331*/ { "[3505]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*332*/ { "[3506]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*333*/ { "[3509]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*334*/ { "[3510]123456", 0, "3510123456", }, + /*335*/ { "[3510]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*336*/ { "[3519]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*337*/ { "[3520]123456", 0, "3520123456", }, + /*338*/ { "[3520]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*339*/ { "[3529]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*340*/ { "[3530]123456", 0, "3530123456", }, + /*341*/ { "[3530]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*342*/ { "[3539]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*343*/ { "[3540]123456", 0, "3540123456", }, + /*344*/ { "[3540]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*345*/ { "[3549]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*346*/ { "[3550]123456", 0, "3550123456", }, + /*347*/ { "[3550]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*348*/ { "[3559]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*349*/ { "[3560]123456", 0, "3560123456", }, + /*350*/ { "[3560]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*351*/ { "[3569]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*352*/ { "[3570]123456", 0, "3570123456", }, + /*353*/ { "[3570]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*354*/ { "[3575]123456", 0, "3575123456" }, + /*355*/ { "[3376]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*356*/ { "[3579]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*357*/ { "[3580]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*358*/ { "[3590]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*359*/ { "[3599]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*360*/ { "[36]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*361*/ { "[360]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*362*/ { "[3600]123456", 0, "3600123456" }, + /*363*/ { "[3600]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*364*/ { "[3605]123456", 0, "3605123456" }, + /*365*/ { "[3605]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*366*/ { "[3606]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*367*/ { "[3609]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*368*/ { "[3610]123456", 0, "3610123456" }, + /*369*/ { "[3610]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*370*/ { "[3619]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*371*/ { "[3620]123456", 0, "3620123456", }, + /*372*/ { "[3620]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*373*/ { "[3629]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*374*/ { "[3630]123456", 0, "3630123456", }, + /*375*/ { "[3630]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*376*/ { "[3639]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*377*/ { "[3640]123456", 0, "3640123456", }, + /*378*/ { "[3640]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*379*/ { "[3649]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*380*/ { "[3650]123456", 0, "3650123456", }, + /*381*/ { "[3650]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*382*/ { "[3659]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*383*/ { "[3660]123456", 0, "3660123456", }, + /*384*/ { "[3660]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*385*/ { "[3669]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*386*/ { "[3670]123456", 0, "3670123456", }, + /*387*/ { "[3670]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*388*/ { "[3679]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*389*/ { "[3680]123456", 0, "3680123456", }, + /*390*/ { "[3680]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*391*/ { "[3689]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*392*/ { "[3690]123456", 0, "3690123456" }, + /*393*/ { "[3690]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*394*/ { "[3695]123456", 0, "3695123456" }, + /*395*/ { "[3695]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*396*/ { "[3696]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*397*/ { "[3699]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*398*/ { "[37]12345678", 0, "3712345678" }, + /*399*/ { "[37]123456789", ZINT_ERROR_INVALID_DATA, "" }, + /*400*/ { "[370]12345678", ZINT_ERROR_INVALID_DATA, "" }, + /*401*/ { "[3700]12345678", ZINT_ERROR_INVALID_DATA, "" }, + /*402*/ { "[38]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*403*/ { "[380]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*404*/ { "[3800]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*405*/ { "[39]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*406*/ { "[390]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*407*/ { "[3900]123456789012345", 0, "3900123456789012345" }, + /*408*/ { "[3900]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*409*/ { "[3900]12345678901234", 0, "390012345678901234" }, + /*410*/ { "[3901]123456789012345", 0, "3901123456789012345" }, + /*411*/ { "[3901]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*412*/ { "[3905]123456789012345", 0, "3905123456789012345" }, + /*413*/ { "[3909]123456789012345", 0, "3909123456789012345" }, + /*414*/ { "[3909]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*415*/ { "[3910]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3910123123456789012345" }, + /*416*/ { "[3910]997123456789012345", 0, "3910997123456789012345" }, + /*417*/ { "[3910]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*418*/ { "[3910]123", ZINT_ERROR_INVALID_DATA, "" }, + /*419*/ { "[3915]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3915123123456789012345" }, + /*420*/ { "[3915]997123456789012345", 0, "3915997123456789012345" }, + /*421*/ { "[3915]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*422*/ { "[3919]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3919123123456789012345" }, + /*423*/ { "[3919]997123456789012345", 0, "3919997123456789012345" }, + /*424*/ { "[3919]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*425*/ { "[3920]123456789012345", 0, "3920123456789012345" }, + /*426*/ { "[3920]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*427*/ { "[3925]123456789012345", 0, "3925123456789012345" }, + /*428*/ { "[3925]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*429*/ { "[3929]123456789012345", 0, "3929123456789012345" }, + /*430*/ { "[3929]1234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*431*/ { "[3930]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3930123123456789012345" }, + /*432*/ { "[3930]997123456789012345", 0, "3930997123456789012345" }, + /*433*/ { "[3930]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*434*/ { "[3930]123", ZINT_ERROR_INVALID_DATA, "" }, + /*435*/ { "[3935]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3935123123456789012345" }, + /*436*/ { "[3935]997123456789012345", 0, "3935997123456789012345" }, + /*437*/ { "[3935]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*438*/ { "[3939]123123456789012345", ZINT_WARN_NONCOMPLIANT, "3939123123456789012345" }, + /*439*/ { "[3939]997123456789012345", 0, "3939997123456789012345" }, + /*440*/ { "[3939]1231234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*441*/ { "[3940]1234", 0, "39401234" }, + /*442*/ { "[3940]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*443*/ { "[3940]123", ZINT_ERROR_INVALID_DATA, "" }, + /*444*/ { "[3941]1234", 0, "39411234" }, + /*445*/ { "[3941]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*446*/ { "[3941]123", ZINT_ERROR_INVALID_DATA, "" }, + /*447*/ { "[3942]1234", 0, "39421234" }, + /*448*/ { "[3942]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*449*/ { "[3943]1234", 0, "39431234" }, + /*450*/ { "[3943]123", ZINT_ERROR_INVALID_DATA, "" }, + /*451*/ { "[3944]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*452*/ { "[3945]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*453*/ { "[3949]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*454*/ { "[3950]123456", 0, "3950123456" }, + /*455*/ { "[3950]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*456*/ { "[3950]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*457*/ { "[3951]123456", 0, "3951123456" }, + /*458*/ { "[3951]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*459*/ { "[3952]123456", 0, "3952123456" }, + /*460*/ { "[3952]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*461*/ { "[3953]123456", 0, "3953123456" }, + /*462*/ { "[3953]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*463*/ { "[3954]123456", 0, "3954123456" }, + /*464*/ { "[3954]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*465*/ { "[3955]123456", 0, "3955123456" }, + /*466*/ { "[3955]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*467*/ { "[3956]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*468*/ { "[3959]123456", ZINT_ERROR_INVALID_DATA, "" }, + /*469*/ { "[3960]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*470*/ { "[3970]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*471*/ { "[3980]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*472*/ { "[3999]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*473*/ { "[40]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*474*/ { "[400]123456789012345678901234567890", 0, "400123456789012345678901234567890" }, + /*475*/ { "[400]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*476*/ { "[4000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*477*/ { "[401]1234abcdefghijklmnopqrstuvwxyz", 0, "4011234abcdefghijklmnopqrstuvwxyz" }, + /*478*/ { "[401]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" }, + /*479*/ { "[4010]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*480*/ { "[402]13131313131313132", ZINT_WARN_NONCOMPLIANT, "40213131313131313132" }, + /*481*/ { "[402]13131313131313130", 0, "40213131313131313130" }, + /*482*/ { "[402]1313131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /*483*/ { "[4020]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*484*/ { "[403]abcdefghijklmnopqrstuvwxyz1234", 0, "403abcdefghijklmnopqrstuvwxyz1234" }, + /*485*/ { "[403]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*486*/ { "[4030]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*487*/ { "[404]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*488*/ { "[4040]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*489*/ { "[409]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*490*/ { "[4090]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*491*/ { "[41]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*492*/ { "[410]3898765432108", 0, "4103898765432108" }, + /*493*/ { "[410]12345678901234", ZINT_ERROR_INVALID_DATA, "" }, + /*494*/ { "[4100]12345678901234", ZINT_ERROR_INVALID_DATA, "" }, + /*495*/ { "[411]1313131313134", ZINT_WARN_NONCOMPLIANT, "4111313131313134" }, + /*496*/ { "[411]1313131313130", 0, "4111313131313130" }, + /*497*/ { "[411]13131313131", ZINT_ERROR_INVALID_DATA, "" }, + /*498*/ { "[4110]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, + /*499*/ { "[412]1313131313130", 0, "4121313131313130" }, + /*500*/ { "[412]13131313131", ZINT_ERROR_INVALID_DATA, "" }, + /*501*/ { "[4120]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, + /*502*/ { "[413]1313131313130", 0, "4131313131313130" }, + /*503*/ { "[413]13131313131", ZINT_ERROR_INVALID_DATA, "" }, + /*504*/ { "[4130]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, + /*505*/ { "[414]1313131313130", 0, "4141313131313130" }, + /*506*/ { "[414]13131313131", ZINT_ERROR_INVALID_DATA, "" }, + /*507*/ { "[4140]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, + /*508*/ { "[415]1313131313130", 0, "4151313131313130" }, + /*509*/ { "[415]13131313131", ZINT_ERROR_INVALID_DATA, "" }, + /*510*/ { "[4150]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, + /*511*/ { "[416]1313131313130", 0, "4161313131313130" }, + /*512*/ { "[416]13131313131", ZINT_ERROR_INVALID_DATA, "" }, + /*513*/ { "[4160]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, + /*514*/ { "[417]1313131313130", 0, "4171313131313130" }, + /*515*/ { "[417]13131313131", ZINT_ERROR_INVALID_DATA, "" }, + /*516*/ { "[4170]1313131313134", ZINT_ERROR_INVALID_DATA, "" }, + /*517*/ { "[418]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*518*/ { "[4180]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*519*/ { "[419]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*520*/ { "[4190]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*521*/ { "[42]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*522*/ { "[420]abcdefghijklmnopqrst", 0, "420abcdefghijklmnopqrst" }, + /*523*/ { "[420]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*524*/ { "[4200]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*525*/ { "[421]123abcdefghi", ZINT_WARN_NONCOMPLIANT, "421123abcdefghi" }, + /*526*/ { "[421]434abcdefghi", 0, "421434abcdefghi" }, + /*527*/ { "[421]123abcdefghij", ZINT_ERROR_INVALID_DATA, "" }, + /*528*/ { "[421]1231", ZINT_WARN_NONCOMPLIANT, "4211231" }, + /*529*/ { "[421]4341", 0, "4214341" }, + /*530*/ { "[421]123", ZINT_ERROR_INVALID_DATA, "" }, + /*531*/ { "[4210]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*532*/ { "[422]123", ZINT_WARN_NONCOMPLIANT, "422123" }, + /*533*/ { "[422]004", 0, "422004" }, + /*534*/ { "[422]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*535*/ { "[422]12", ZINT_ERROR_INVALID_DATA, "" }, + /*536*/ { "[4220]123", ZINT_ERROR_INVALID_DATA, "" }, + /*537*/ { "[423]123123123123123", ZINT_WARN_NONCOMPLIANT, "423123123123123123" }, + /*538*/ { "[423]470004012887123", ZINT_WARN_NONCOMPLIANT, "423470004012887123" }, + /*539*/ { "[423]470004012887438", 0, "423470004012887438" }, + /*540*/ { "[423]1231231231231231", ZINT_ERROR_INVALID_DATA, "4231231231231231231" }, + /*541*/ { "[423]12312312312312", ZINT_WARN_NONCOMPLIANT, "42312312312312312" }, + /*542*/ { "[423]1231231231231", ZINT_WARN_NONCOMPLIANT, "4231231231231231" }, + /*543*/ { "[423]12312312312", ZINT_WARN_NONCOMPLIANT, "42312312312312" }, + /*544*/ { "[423]1231231231", ZINT_WARN_NONCOMPLIANT, "4231231231231" }, + /*545*/ { "[423]123", ZINT_WARN_NONCOMPLIANT, "423123" }, + /*546*/ { "[423]004", 0, "423004" }, + /*547*/ { "[423]12", ZINT_ERROR_INVALID_DATA, "" }, + /*548*/ { "[4230]123123123123123", ZINT_ERROR_INVALID_DATA, "" }, + /*549*/ { "[424]123", ZINT_WARN_NONCOMPLIANT, "424123" }, + /*550*/ { "[424]004", 0, "424004" }, + /*551*/ { "[424]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*552*/ { "[424]12", ZINT_ERROR_INVALID_DATA, "" }, + /*553*/ { "[4240]123", ZINT_ERROR_INVALID_DATA, "" }, + /*554*/ { "[425]123123123123123", ZINT_WARN_NONCOMPLIANT, "425123123123123123" }, + /*555*/ { "[425]010500276634894", 0, "425010500276634894" }, + /*556*/ { "[425]010500276123894", ZINT_WARN_NONCOMPLIANT, "425010500276123894" }, + /*557*/ { "[425]1231231231231231", ZINT_ERROR_INVALID_DATA, "" }, + /*558*/ { "[425]12", ZINT_ERROR_INVALID_DATA, "" }, + /*559*/ { "[4250]123123123123123", ZINT_ERROR_INVALID_DATA, "" }, + /*560*/ { "[426]123", ZINT_WARN_NONCOMPLIANT, "426123" }, + /*561*/ { "[426]426", 0, "426426" }, + /*562*/ { "[426]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*563*/ { "[426]12", ZINT_ERROR_INVALID_DATA, "" }, + /*564*/ { "[4260]123", ZINT_ERROR_INVALID_DATA, "" }, + /*565*/ { "[427]abc", 0, "427abc" }, + /*566*/ { "[427]abcd", ZINT_ERROR_INVALID_DATA, "" }, + /*567*/ { "[4270]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*568*/ { "[428]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*569*/ { "[4280]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*570*/ { "[429]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*571*/ { "[4290]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*572*/ { "[43]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*573*/ { "[430]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*574*/ { "[4300]1", 0, "43001" }, + /*575*/ { "[4300]12345678901234567890123456789012345", 0, "430012345678901234567890123456789012345" }, + /*576*/ { "[4300]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*577*/ { "[4301]1", 0, "43011" }, + /*578*/ { "[4301]12345678901234567890123456789012345", 0, "430112345678901234567890123456789012345" }, + /*579*/ { "[4301]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*580*/ { "[4302]1", 0, "43021" }, + /*581*/ { "[4302]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43021234567890123456789012345678901234567890123456789012345678901234567890" }, + /*582*/ { "[4302]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*583*/ { "[4303]1", 0, "43031" }, + /*584*/ { "[4303]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43031234567890123456789012345678901234567890123456789012345678901234567890" }, + /*585*/ { "[4303]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*586*/ { "[4304]1", 0, "43041" }, + /*587*/ { "[4304]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43041234567890123456789012345678901234567890123456789012345678901234567890" }, + /*588*/ { "[4304]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*589*/ { "[4305]1", 0, "43051" }, + /*590*/ { "[4305]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43051234567890123456789012345678901234567890123456789012345678901234567890" }, + /*591*/ { "[4305]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*592*/ { "[4306]1", 0, "43061" }, + /*593*/ { "[4306]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43061234567890123456789012345678901234567890123456789012345678901234567890" }, + /*594*/ { "[4306]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*595*/ { "[4307]FR", 0, "4307FR" }, + /*596*/ { "[4307]F", ZINT_ERROR_INVALID_DATA, "" }, + /*597*/ { "[4307]FRR", ZINT_ERROR_INVALID_DATA, "" }, + /*598*/ { "[4308]1", 0, "43081" }, + /*599*/ { "[4308]123456789012345678901234567890", 0, "4308123456789012345678901234567890" }, + /*600*/ { "[4308]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*601*/ { "[4309]1", ZINT_ERROR_INVALID_DATA, "" }, + /*602*/ { "[431]1", ZINT_ERROR_INVALID_DATA, "" }, + /*603*/ { "[4310]1", 0, "43101" }, + /*604*/ { "[4310]12345678901234567890123456789012345", 0, "431012345678901234567890123456789012345" }, + /*605*/ { "[4310]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*606*/ { "[4311]1", 0, "43111" }, + /*607*/ { "[4311]12345678901234567890123456789012345", 0, "431112345678901234567890123456789012345" }, + /*608*/ { "[4311]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*609*/ { "[4312]1", 0, "43121" }, + /*610*/ { "[4312]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43121234567890123456789012345678901234567890123456789012345678901234567890" }, + /*611*/ { "[4312]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*612*/ { "[4313]1", 0, "43131" }, + /*613*/ { "[4313]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43131234567890123456789012345678901234567890123456789012345678901234567890" }, + /*614*/ { "[4313]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*615*/ { "[4314]1", 0, "43141" }, + /*616*/ { "[4314]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43141234567890123456789012345678901234567890123456789012345678901234567890" }, + /*617*/ { "[4314]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*618*/ { "[4315]1", 0, "43151" }, + /*619*/ { "[4315]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43151234567890123456789012345678901234567890123456789012345678901234567890" }, + /*620*/ { "[4315]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*621*/ { "[4316]1", 0, "43161" }, + /*622*/ { "[4316]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43161234567890123456789012345678901234567890123456789012345678901234567890" }, + /*623*/ { "[4316]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*624*/ { "[4317]FR", 0, "4317FR" }, + /*625*/ { "[4317]F", ZINT_ERROR_INVALID_DATA, "" }, + /*626*/ { "[4317]FRF", ZINT_ERROR_INVALID_DATA, "" }, + /*627*/ { "[4318]1", 0, "43181" }, + /*628*/ { "[4318]12345678901234567890", 0, "431812345678901234567890" }, + /*629*/ { "[4318]123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*630*/ { "[4319]1", 0, "43191" }, + /*631*/ { "[4319]123456789012345678901234567890", 0, "4319123456789012345678901234567890" }, + /*632*/ { "[4319]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*633*/ { "[432]1", ZINT_ERROR_INVALID_DATA, "" }, + /*634*/ { "[4320]1", 0, "43201" }, + /*635*/ { "[4320]12345678901234567890123456789012345", 0, "432012345678901234567890123456789012345" }, + /*636*/ { "[4320]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*637*/ { "[4321]1", 0, "43211" }, + /*638*/ { "[4321]10", ZINT_ERROR_INVALID_DATA, "" }, + /*639*/ { "[4322]1", 0, "43221" }, + /*640*/ { "[4322]10", ZINT_ERROR_INVALID_DATA, "" }, + /*641*/ { "[4323]1", 0, "43231" }, + /*642*/ { "[4323]10", ZINT_ERROR_INVALID_DATA, "" }, + /*643*/ { "[4324]1212120000", 0, "43241212120000" }, + /*644*/ { "[4324]121212000", ZINT_ERROR_INVALID_DATA, "" }, + /*645*/ { "[4324]12121200000", ZINT_ERROR_INVALID_DATA, "" }, + /*646*/ { "[4325]1212120000", 0, "43251212120000" }, + /*647*/ { "[4325]121212000", ZINT_ERROR_INVALID_DATA, "" }, + /*648*/ { "[4325]12121200000", ZINT_ERROR_INVALID_DATA, "" }, + /*649*/ { "[4326]121212", 0, "4326121212" }, + /*650*/ { "[4326]12121", ZINT_ERROR_INVALID_DATA, "" }, + /*651*/ { "[4326]1212120", ZINT_ERROR_INVALID_DATA, "" }, + /*652*/ { "[4327]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*653*/ { "[4328]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*654*/ { "[4329]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*655*/ { "[433]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*656*/ { "[4330]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*657*/ { "[44]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*658*/ { "[440]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*659*/ { "[4400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*660*/ { "[49]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*661*/ { "[490]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*662*/ { "[4900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*663*/ { "[499]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*664*/ { "[4990]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*665*/ { "[50]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*666*/ { "[500]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*667*/ { "[5000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*668*/ { "[51]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*669*/ { "[510]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*670*/ { "[5100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*671*/ { "[59]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*672*/ { "[590]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*673*/ { "[5900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*674*/ { "[60]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*675*/ { "[600]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*676*/ { "[6000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*677*/ { "[61]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*678*/ { "[610]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*679*/ { "[6100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*680*/ { "[69]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*681*/ { "[690]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*682*/ { "[6900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*683*/ { "[70]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*684*/ { "[700]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*685*/ { "[7000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*686*/ { "[7001]1234567890123", 0, "70011234567890123" }, + /*687*/ { "[7001]123456789012", ZINT_ERROR_INVALID_DATA, "" }, + /*688*/ { "[7002]abcdefghijklmnopqrstuvwxyz1234", 0, "7002abcdefghijklmnopqrstuvwxyz1234" }, + /*689*/ { "[7002]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*690*/ { "[7003]1212121212", 0, "70031212121212" }, + /*691*/ { "[7003]121212121", ZINT_ERROR_INVALID_DATA, "" }, + /*692*/ { "[7004]1234", 0, "70041234" }, + /*693*/ { "[7004]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*694*/ { "[7005]abcdefghijkl", 0, "7005abcdefghijkl" }, + /*695*/ { "[7005]abcdefghijklm", ZINT_ERROR_INVALID_DATA, "" }, + /*696*/ { "[7006]200132", ZINT_WARN_NONCOMPLIANT, "7006200132" }, + /*697*/ { "[7006]200100", ZINT_WARN_NONCOMPLIANT, "7006200100" }, + /*698*/ { "[7006]200120", 0, "7006200120" }, + /*699*/ { "[7006]2001320", ZINT_ERROR_INVALID_DATA, "" }, + /*700*/ { "[7007]010101121212", 0, "7007010101121212" }, + /*701*/ { "[7007]01010112121", ZINT_ERROR_INVALID_DATA, "" }, + /*702*/ { "[7007]A1010112121", ZINT_ERROR_INVALID_DATA, "" }, + /*703*/ { "[7007]121212", 0, "7007121212" }, + /*704*/ { "[7007]12121", ZINT_ERROR_INVALID_DATA, "" }, + /*705*/ { "[7007]1212121", ZINT_ERROR_INVALID_DATA, "" }, + /*706*/ { "[7008]abc", 0, "7008abc" }, + /*707*/ { "[7008]abcd", ZINT_ERROR_INVALID_DATA, "" }, + /*708*/ { "[7009]abcdefghij", 0, "7009abcdefghij" }, + /*709*/ { "[7009]abcdefghijk", ZINT_ERROR_INVALID_DATA, "" }, + /*710*/ { "[7010]01", 0, "701001" }, + /*711*/ { "[7010]1", 0, "70101" }, + /*712*/ { "[7010]012", ZINT_ERROR_INVALID_DATA, "" }, + /*713*/ { "[7011]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*714*/ { "[7012]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*715*/ { "[7019]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*716*/ { "[7020]abcdefghijklmnopqrst", 0, "7020abcdefghijklmnopqrst" }, + /*717*/ { "[7020]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*718*/ { "[7021]abcdefghijklmnopqrst", 0, "7021abcdefghijklmnopqrst" }, + /*719*/ { "[7021]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*720*/ { "[7022]abcdefghijklmnopqrst", 0, "7022abcdefghijklmnopqrst" }, + /*721*/ { "[7022]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*722*/ { "[7023]1234abcdefghijklmnopqrstuvwxyz", 0, "70231234abcdefghijklmnopqrstuvwxyz" }, + /*723*/ { "[7023]1234abcdefghijklmnopqrstuvwxyza", ZINT_ERROR_INVALID_DATA, "" }, + /*724*/ { "[7024]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*725*/ { "[7025]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*726*/ { "[7029]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*727*/ { "[7030]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7030123abcdefghijklmnopqrstuvwxyza" }, + /*728*/ { "[7030]004abcdefghijklmnopqrstuvwxyza", 0, "7030004abcdefghijklmnopqrstuvwxyza" }, + /*729*/ { "[7030]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*730*/ { "[7031]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7031123abcdefghijklmnopqrstuvwxyza" }, + /*731*/ { "[7031]004abcdefghijklmnopqrstuvwxyza", 0, "7031004abcdefghijklmnopqrstuvwxyza" }, + /*732*/ { "[7031]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*733*/ { "[7032]004abcdefghijklmnopqrstuvwxyza", 0, "7032004abcdefghijklmnopqrstuvwxyza" }, + /*734*/ { "[7032]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*735*/ { "[7033]004abcdefghijklmnopqrstuvwxyza", 0, "7033004abcdefghijklmnopqrstuvwxyza" }, + /*736*/ { "[7033]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*737*/ { "[7034]004abcdefghijklmnopqrstuvwxyza", 0, "7034004abcdefghijklmnopqrstuvwxyza" }, + /*738*/ { "[7034]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*739*/ { "[7035]004abcdefghijklmnopqrstuvwxyza", 0, "7035004abcdefghijklmnopqrstuvwxyza" }, + /*740*/ { "[7035]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*741*/ { "[7036]004abcdefghijklmnopqrstuvwxyza", 0, "7036004abcdefghijklmnopqrstuvwxyza" }, + /*742*/ { "[7036]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*743*/ { "[7037]004abcdefghijklmnopqrstuvwxyza", 0, "7037004abcdefghijklmnopqrstuvwxyza" }, + /*744*/ { "[7037]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*745*/ { "[7038]004abcdefghijklmnopqrstuvwxyza", 0, "7038004abcdefghijklmnopqrstuvwxyza" }, + /*746*/ { "[7038]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*747*/ { "[7039]004abcdefghijklmnopqrstuvwxyza", 0, "7039004abcdefghijklmnopqrstuvwxyza" }, + /*748*/ { "[7039]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*749*/ { "[7040]1abc", 0, "70401abc" }, + /*750*/ { "[7040]1ab", ZINT_ERROR_INVALID_DATA, "" }, + /*751*/ { "[7040]1abcd", ZINT_ERROR_INVALID_DATA, "" }, + /*752*/ { "[7041]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*753*/ { "[7042]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*754*/ { "[7050]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*755*/ { "[7090]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*756*/ { "[7099]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*757*/ { "[71]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*758*/ { "[710]abcdefghijklmnopqrst", 0, "710abcdefghijklmnopqrst" }, + /*759*/ { "[710]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*760*/ { "[7100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*761*/ { "[711]abcdefghijklmnopqrst", 0, "711abcdefghijklmnopqrst" }, + /*762*/ { "[711]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*763*/ { "[712]abcdefghijklmnopqrst", 0, "712abcdefghijklmnopqrst" }, + /*764*/ { "[712]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*765*/ { "[713]abcdefghijklmnopqrst", 0, "713abcdefghijklmnopqrst" }, + /*766*/ { "[713]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*767*/ { "[714]abcdefghijklmnopqrst", 0, "714abcdefghijklmnopqrst" }, + /*768*/ { "[714]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*769*/ { "[715]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*770*/ { "[716]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*771*/ { "[719]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*772*/ { "[72]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*773*/ { "[720]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*774*/ { "[7200]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*775*/ { "[721]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*776*/ { "[7210]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*777*/ { "[7220]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*778*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzab", 0, "7230EMabcdefghijklmnopqrstuvwxyzab" }, + /*779*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*780*/ { "[7230]EM", ZINT_ERROR_INVALID_DATA, "" }, + /*781*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzab", 0, "7231EMabcdefghijklmnopqrstuvwxyzab" }, + /*782*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*783*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzab", 0, "7232EMabcdefghijklmnopqrstuvwxyzab" }, + /*784*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*785*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzab", 0, "7233EMabcdefghijklmnopqrstuvwxyzab" }, + /*786*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*787*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzab", 0, "7234EMabcdefghijklmnopqrstuvwxyzab" }, + /*788*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*789*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzab", 0, "7235EMabcdefghijklmnopqrstuvwxyzab" }, + /*790*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*791*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzab", 0, "7236EMabcdefghijklmnopqrstuvwxyzab" }, + /*792*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*793*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzab", 0, "7237EMabcdefghijklmnopqrstuvwxyzab" }, + /*794*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*795*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzab", 0, "7238EMabcdefghijklmnopqrstuvwxyzab" }, + /*796*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*797*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzab", 0, "7239EMabcdefghijklmnopqrstuvwxyzab" }, + /*798*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*799*/ { "[7239]E", ZINT_ERROR_INVALID_DATA, "" }, + /*800*/ { "[7240]abcdefghijklmnopqrst", 0, "7240abcdefghijklmnopqrst" }, + /*801*/ { "[7240]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*802*/ { "[7241]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*803*/ { "[7249]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*804*/ { "[7250]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*805*/ { "[7299]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*806*/ { "[73]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*807*/ { "[7300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*808*/ { "[74]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*809*/ { "[7400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*810*/ { "[79]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*811*/ { "[7900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*812*/ { "[7999]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*813*/ { "[80]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*814*/ { "[800]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*815*/ { "[8000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*816*/ { "[8001]12345678901234", ZINT_WARN_NONCOMPLIANT, "800112345678901234" }, + /*817*/ { "[8001]12345678901204", 0, "800112345678901204" }, + /*818*/ { "[8001]1234123456789012345", ZINT_ERROR_INVALID_DATA, "" }, + /*819*/ { "[8002]abcdefghijklmnopqrst", 0, "8002abcdefghijklmnopqrst" }, + /*820*/ { "[8002]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*821*/ { "[8003]01234567890123abcdefghijklmnop", ZINT_WARN_NONCOMPLIANT, "800301234567890123abcdefghijklmnop" }, + /*822*/ { "[8003]01234567890128abcdefghijklmnop", 0, "800301234567890128abcdefghijklmnop" }, + /*823*/ { "[8003]01234567890128abcdefghijklmnopq", ZINT_ERROR_INVALID_DATA, "" }, + /*824*/ { "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_WARN_NONCOMPLIANT, "8004abcdefghijklmnopqrstuvwxyz1234" }, + /*825*/ { "[8004]12cdefghijklmnopqrstuvwxyz1234", 0, "800412cdefghijklmnopqrstuvwxyz1234" }, + /*826*/ { "[8004]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*827*/ { "[8005]123456", 0, "8005123456" }, + /*828*/ { "[8005]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*829*/ { "[8005]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*830*/ { "[8006]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8006123456789012341212" }, + /*831*/ { "[8006]123456789012311212", 0, "8006123456789012311212" }, + /*832*/ { "[8006]12345678901234121", ZINT_ERROR_INVALID_DATA, "" }, + /*833*/ { "[8006]1234567890123412123", ZINT_ERROR_INVALID_DATA, "" }, + /*834*/ { "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_WARN_NONCOMPLIANT, "8007abcdefghijklmnopqrstuvwxyz12345678" }, + /*835*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678" }, + /*836*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ123456789", ZINT_ERROR_INVALID_DATA, "" }, + /*837*/ { "[8008]123456121212", ZINT_WARN_NONCOMPLIANT, "8008123456121212" }, + /*838*/ { "[8008]121256121212", ZINT_WARN_NONCOMPLIANT, "8008121256121212" }, + /*839*/ { "[8008]121231121212", 0, "8008121231121212" }, + /*840*/ { "[8008]1234561212", ZINT_WARN_NONCOMPLIANT, "80081234561212" }, + /*841*/ { "[8008]1212311212", 0, "80081212311212" }, + /*842*/ { "[8008]12345612", ZINT_WARN_NONCOMPLIANT, "800812345612" }, + /*843*/ { "[8008]12010112", 0, "800812010112" }, + /*844*/ { "[8008]1234561", ZINT_ERROR_INVALID_DATA, "" }, + /*845*/ { "[8008]123456121", ZINT_ERROR_INVALID_DATA, "" }, + /*846*/ { "[8008]12345612121", ZINT_ERROR_INVALID_DATA, "" }, + /*847*/ { "[8008]1234561212123", ZINT_ERROR_INVALID_DATA, "" }, + /*848*/ { "[8009]12345678901234567890123456789012345678901234567890", 0, "800912345678901234567890123456789012345678901234567890" }, + /*849*/ { "[8009]123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*850*/ { "[8010]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" }, + /*851*/ { "[8011]123456789012", 0, "8011123456789012" }, + /*852*/ { "[8011]1234567890123", ZINT_ERROR_INVALID_DATA, "" }, + /*853*/ { "[8012]abcdefghijklmnopqrst", 0, "8012abcdefghijklmnopqrst" }, + /*854*/ { "[8012]abcdefghijklmnopqrstuv", ZINT_ERROR_INVALID_DATA, "" }, + /*855*/ { "[8013]1234abcdefghijklmnopqrstuvwxyz", 0, "80131234abcdefghijklmnopqrstuvwxyz" }, + /*856*/ { "[8013]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" }, + /*857*/ { "[8014]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*858*/ { "[8016]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*859*/ { "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139" }, + /*860*/ { "[8017]313131313131313131", 0, "8017313131313131313131" }, + /*861*/ { "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /*862*/ { "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, + /*863*/ { "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139" }, + /*864*/ { "[8018]313131313131313131", 0, "8018313131313131313131" }, + /*865*/ { "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /*866*/ { "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, + /*867*/ { "[8019]1234567890", 0, "80191234567890" }, + /*868*/ { "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*869*/ { "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy" }, + /*870*/ { "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "" }, + /*871*/ { "[8021]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*872*/ { "[8025]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*873*/ { "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212" }, + /*874*/ { "[8026]123456789012311212", 0, "8026123456789012311212" }, + /*875*/ { "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "" }, + /*876*/ { "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "" }, + /*877*/ { "[8027]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*878*/ { "[8030]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*879*/ { "[8040]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*880*/ { "[8050]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*881*/ { "[8060]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*882*/ { "[8070]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*883*/ { "[8080]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*884*/ { "[8090]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*885*/ { "[8099]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*886*/ { "[81]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*887*/ { "[8100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*888*/ { "[8109]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*889*/ { "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000" }, + /*890*/ { "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "" }, + /*891*/ { "[8111]1234", 0, "81111234" }, + /*892*/ { "[8111]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*893*/ { "[8111]123", ZINT_ERROR_INVALID_DATA, "" }, + /*894*/ { "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890" }, + /*895*/ { "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*896*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345" }, + /*897*/ { "[8113]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*898*/ { "[8120]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*899*/ { "[8130]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*900*/ { "[8140]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*901*/ { "[8150]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*902*/ { "[8190]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*903*/ { "[8199]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*904*/ { "[82]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*905*/ { "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890" }, + /*906*/ { "[8201]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*907*/ { "[8210]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*908*/ { "[8220]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*909*/ { "[8230]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*910*/ { "[8240]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*911*/ { "[8250]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*912*/ { "[8290]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*913*/ { "[8299]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*914*/ { "[83]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*915*/ { "[830]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*916*/ { "[8300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*917*/ { "[84]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*918*/ { "[840]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*919*/ { "[8400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*920*/ { "[85]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*921*/ { "[850]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*922*/ { "[8500]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*923*/ { "[89]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*924*/ { "[890]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*925*/ { "[8900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*926*/ { "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234" }, + /*927*/ { "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*928*/ { "[900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*929*/ { "[9000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*930*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*931*/ { "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*932*/ { "[910]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*933*/ { "[9100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*934*/ { "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*935*/ { "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*936*/ { "[920]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*937*/ { "[9200]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*938*/ { "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*939*/ { "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*940*/ { "[930]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*941*/ { "[9300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*942*/ { "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*943*/ { "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*944*/ { "[940]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*945*/ { "[9400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*946*/ { "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*947*/ { "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*948*/ { "[950]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*949*/ { "[9500]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*950*/ { "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*951*/ { "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*952*/ { "[960]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*953*/ { "[9600]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*954*/ { "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*955*/ { "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*956*/ { "[970]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*957*/ { "[9700]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*958*/ { "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*959*/ { "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*960*/ { "[980]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*961*/ { "[9800]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*962*/ { "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*963*/ { "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*964*/ { "[990]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*965*/ { "[9900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*966*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*967*/ { "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101" }, + /*968*/ { "[01]12345678901231[7006]200101", 0, "01123456789012317006200101" }, + /*969*/ { "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890[0112345678901234" }, + /*970*/ { "[3900]1234567890[01]12345678901231", 0, "39001234567890[0112345678901231" }, + /*971*/ { "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[390112345678901234[2012" }, + /*972*/ { "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284[390112345678901234[2012" }, + /*973*/ { "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[0112345678901234390112345678901234[2012" }, + /*974*/ { "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284[0112345678901231390112345678901234[2012" }, }; int data_size = ARRAY_SIZE(data); @@ -1685,40 +1687,40 @@ static void test_input_mode(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_AZTEC, "[01]12345678901234", "", GS1_MODE, -1 , 0, 0 }, - /* 1*/ { BARCODE_AZTEC, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, - /* 2*/ { BARCODE_AZTEC, "[01]12345678901234", "", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 }, - /* 3*/ { BARCODE_AZTEC, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 }, + /* 0*/ { BARCODE_AZTEC, "[01]12345678901231", "", GS1_MODE, -1 , 0, 0 }, + /* 1*/ { BARCODE_AZTEC, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, + /* 2*/ { BARCODE_AZTEC, "[01]12345678901231", "", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 }, + /* 3*/ { BARCODE_AZTEC, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 }, /* 4*/ { BARCODE_AZTEC, "1234", "", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* 5*/ { BARCODE_AZTEC, "1234", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, - /* 6*/ { BARCODE_CODABLOCKF, "[01]12345678901234", "", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, - /* 7*/ { BARCODE_CODABLOCKF, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, + /* 6*/ { BARCODE_CODABLOCKF, "[01]12345678901231", "", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, + /* 7*/ { BARCODE_CODABLOCKF, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, /* 8*/ { BARCODE_CODABLOCKF, "1234", "", GS1_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, /* 9*/ { BARCODE_CODABLOCKF, "1234", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_OPTION, 0 }, - /* 10*/ { BARCODE_CODEONE, "[01]12345678901234", "", GS1_MODE, -1, 0, 0 }, - /* 11*/ { BARCODE_CODEONE, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, + /* 10*/ { BARCODE_CODEONE, "[01]12345678901231", "", GS1_MODE, -1, 0, 0 }, + /* 11*/ { BARCODE_CODEONE, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, /* 12*/ { BARCODE_CODEONE, "1234", "", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* 13*/ { BARCODE_CODEONE, "1234", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, - /* 14*/ { BARCODE_CODE16K, "[01]12345678901234", "", GS1_MODE, -1, 0, 0 }, - /* 15*/ { BARCODE_CODE16K, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, + /* 14*/ { BARCODE_CODE16K, "[01]12345678901231", "", GS1_MODE, -1, 0, 0 }, + /* 15*/ { BARCODE_CODE16K, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, /* 16*/ { BARCODE_CODE16K, "1234", "", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* 17*/ { BARCODE_CODE16K, "1234", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, - /* 18*/ { BARCODE_CODE49, "[01]12345678901234", "", GS1_MODE, -1, 0, 0 }, - /* 19*/ { BARCODE_CODE49, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, + /* 18*/ { BARCODE_CODE49, "[01]12345678901231", "", GS1_MODE, -1, 0, 0 }, + /* 19*/ { BARCODE_CODE49, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, /* 20*/ { BARCODE_CODE49, "1234", "", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* 21*/ { BARCODE_CODE49, "1234", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, - /* 22*/ { BARCODE_DATAMATRIX, "[01]12345678901234", "", GS1_MODE, -1, 0, 0 }, - /* 23*/ { BARCODE_DATAMATRIX, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, - /* 24*/ { BARCODE_DATAMATRIX, "[01]12345678901234", "", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 }, - /* 25*/ { BARCODE_DATAMATRIX, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 }, + /* 22*/ { BARCODE_DATAMATRIX, "[01]12345678901231", "", GS1_MODE, -1, 0, 0 }, + /* 23*/ { BARCODE_DATAMATRIX, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, + /* 24*/ { BARCODE_DATAMATRIX, "[01]12345678901231", "", GS1_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 }, + /* 25*/ { BARCODE_DATAMATRIX, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, READER_INIT, ZINT_ERROR_INVALID_OPTION, 0 }, /* 26*/ { BARCODE_DATAMATRIX, "1234", "", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* 27*/ { BARCODE_DATAMATRIX, "1234", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, - /* 28*/ { BARCODE_DOTCODE, "[01]12345678901234", "", GS1_MODE, -1, 0, 0 }, - /* 29*/ { BARCODE_DOTCODE, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, + /* 28*/ { BARCODE_DOTCODE, "[01]12345678901231", "", GS1_MODE, -1, 0, 0 }, + /* 29*/ { BARCODE_DOTCODE, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, /* 30*/ { BARCODE_DOTCODE, "1234", "", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* 31*/ { BARCODE_DOTCODE, "1234", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, - /* 32*/ { BARCODE_QRCODE, "[01]12345678901234", "", GS1_MODE, -1, 0, 0 }, - /* 33*/ { BARCODE_QRCODE, "[01]12345678901234", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, + /* 32*/ { BARCODE_QRCODE, "[01]12345678901231", "", GS1_MODE, -1, 0, 0 }, + /* 33*/ { BARCODE_QRCODE, "[01]12345678901231", "", GS1_MODE | ESCAPE_MODE, -1, 0, 1 }, /* 34*/ { BARCODE_QRCODE, "1234", "", GS1_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, /* 35*/ { BARCODE_QRCODE, "1234", "", GS1_MODE | ESCAPE_MODE, -1, ZINT_ERROR_INVALID_DATA, 0 }, }; diff --git a/backend/tests/test_library.c b/backend/tests/test_library.c index 7b516a54..3a1f193b 100644 --- a/backend/tests/test_library.c +++ b/backend/tests/test_library.c @@ -99,7 +99,7 @@ static void test_checks(int index, int debug) { /* 41*/ { 146, "1", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 216: Symbology out of range", -1 }, /* 42*/ { BARCODE_CODE128, "\200", -1, UNICODE_MODE, -1, -1, -1, ZINT_ERROR_INVALID_DATA, "Error 245: Invalid UTF-8", -1 }, }; - int data_size = sizeof(data) / sizeof(struct item); + int data_size = ARRAY_SIZE(data); for (int i = 0; i < data_size; i++) { @@ -152,8 +152,8 @@ static void test_input_mode(int index, int debug) { /* 1*/ { "1234", DATA_MODE | ESCAPE_MODE, 0, DATA_MODE | ESCAPE_MODE }, /* 2*/ { "1234", UNICODE_MODE, 0, UNICODE_MODE }, /* 3*/ { "1234", UNICODE_MODE | ESCAPE_MODE, 0, UNICODE_MODE | ESCAPE_MODE }, - /* 4*/ { "[01]12345678901234", GS1_MODE, 0, GS1_MODE }, - /* 5*/ { "[01]12345678901234", GS1_MODE | ESCAPE_MODE, 0, GS1_MODE | ESCAPE_MODE }, + /* 4*/ { "[01]12345678901231", GS1_MODE, 0, GS1_MODE }, + /* 5*/ { "[01]12345678901231", GS1_MODE | ESCAPE_MODE, 0, GS1_MODE | ESCAPE_MODE }, /* 6*/ { "1234", 4 | ESCAPE_MODE, 0, DATA_MODE }, // Unknown mode reset to bare DATA_MODE /* 7*/ { "1234", -1, 0, DATA_MODE }, /* 8*/ { "1234", DATA_MODE | 0x10, 0, DATA_MODE | 0x10 }, // Unknown flags kept (but ignored) diff --git a/backend/tests/test_qr.c b/backend/tests/test_qr.c index 5b62782c..42b08b9f 100644 --- a/backend/tests/test_qr.c +++ b/backend/tests/test_qr.c @@ -322,7 +322,7 @@ static void test_qr_gs1(int index, int generate, int debug) { char *comment; }; struct item data[] = { - /* 0*/ { "[01]12345678901234", 0, "51 04 00 B3 AA 37 DE 87 B4", "N16" }, + /* 0*/ { "[01]12345678901231", 0, "51 04 00 B3 AA 37 DE 87 B1", "N16" }, /* 1*/ { "[01]04912345123459[15]970331[30]128[10]ABC123", 0, "51 07 40 A7 AC EA 80 15 9E 4F CA 52 D2 D3 84 09 D5 E0 28 FD 82 F0 C0 EC 11 EC 11 EC", "N29 A9" }, /* 2*/ { "[91]12%[20]12", 0, "52 05 99 60 5F B5 35 80 01 08 00 EC 11", "A10(11)" }, /* 3*/ { "[91]123%[20]12", 0, "52 06 19 60 5E 2B 76 A0 5A 05 E0 EC 11", "A11(12)" }, @@ -2528,7 +2528,7 @@ static void test_rmqr_gs1(int index, int generate, int debug) { char *comment; }; struct item data[] = { - /* 0*/ { "[01]12345678901234", 0, "A6 00 59 D5 1B EF 43 DA 00 EC 11 EC", "N16" }, + /* 0*/ { "[01]12345678901231", 0, "A6 00 59 D5 1B EF 43 D8 80 EC 11 EC", "N16" }, /* 1*/ { "[01]04912345123459[15]970331[30]128[10]ABC123", 0, "A5 D0 29 EB 3A A0 05 67 93 F2 94 B4 B4 E2 4E AF 01 47 EC 17 86", "N29 A9" }, /* 2*/ { "[91]12%[20]12", 0, "A4 9C 79 32 25 1D 24 32 48 00 EC 11", "N4 B2 N4" }, /* 3*/ { "[91]123%[20]12", 0, "A4 BC 79 74 3D A9 31 21 92 40 EC 11", "N5 A2 N4" }, diff --git a/backend/vector.c b/backend/vector.c index 8e03a4e4..f8ce4850 100644 --- a/backend/vector.c +++ b/backend/vector.c @@ -1,7 +1,7 @@ /* vector.c - Creates vector image objects libzint - the open source barcode library - Copyright (C) 2018 - 2020 Robin Stuart + Copyright (C) 2018 - 2021 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -35,6 +35,10 @@ #ifdef _MSC_VER #include +/* For Visual C++ 6 suppress conversion from int to float warning */ +#if _MSC_VER == 1200 +#pragma warning(disable: 4244) +#endif #endif #include "common.h" @@ -252,7 +256,7 @@ static void vector_rotate(struct zint_symbol *symbol, int rotate_angle) { struct zint_vector_hexagon *hex; struct zint_vector_circle *circle; struct zint_vector_string *string; - int temp; + float temp; if (rotate_angle == 0) { // No rotation needed diff --git a/docs/manual.txt b/docs/manual.txt index 9f918ab6..9e620e5a 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -194,10 +194,10 @@ Code 128, and output to the default file out.png in the current directory. Alternatively, if libpng was not present when Zint was built, the default output file will be out.gif. -The data input to Zint is assumed to be encoded in Unicode (UTF-8) format. If -you are encoding characters beyond the 7-bit ASCII set using a scheme other than -UTF-8 then you will need to set the appropriate input options as shown in -section 4.10 below. +The data input to Zint is assumed to be encoded in Unicode (UTF-8) format (Zint +will correctly handle UTF-8 data on Windows). If you are encoding characters +beyond the 7-bit ASCII set using a scheme other than UTF-8 then you will need to +set the appropriate input options as shown in section 4.10 below. Non-printing characters can be entered on the command line using the backslash (\) as an escape character in combination with the --esc switch. Permissible @@ -255,110 +255,122 @@ zint -o there.eps -d "This Text" Selecting which type of barcode you wish to produce (i.e. which symbology to use) can be done at the command line using the -b or --barcode= switch followed by the appropriate integer value in the following table. For example to create -a Data Matrix symbol you could use: +by the appropriate integer value or name in the following table. For example to +create a Data Matrix symbol you could use: -zint -o datamatrix.png -b 71 -d "Data to encode" +zint -b 71 -o datamatrix.png -d "Data to encode" + +or + +zint -b DATAMATRIX -o datamatrix.png -d "Data to encode" -------------------------------------------------------------------------------- -Numeric Value | Barcode Name +Numeric | Name (case- | Barcode Name +Value | insensitive) | -------------------------------------------------------------------------------- -1 | Code 11 -2 | Standard Code 2 of 5 -3 | Interleaved 2 of 5 -4 | Code 2 of 5 IATA -6 | Code 2 of 5 Data Logic -7 | Code 2 of 5 Industrial -8 | Code 3 of 9 (Code 39) -9 | Extended Code 3 of 9 (Code 39+) -13 | EAN (including EAN-8 and EAN-13) -14 | EAN + Check Digit -16 | GS1-128 (UCC.EAN-128) -18 | Codabar -20 | Code 128 (automatic subset switching) -21 | Deutshe Post Leitcode -22 | Deutshe Post Identcode -23 | Code 16K -24 | Code 49 -25 | Code 93 -28 | Flattermarken -29 | GS1 DataBar Omnidirectional (including GS1 DataBar Truncated) -30 | GS1 DataBar Limited -31 | GS1 DataBar Expanded -32 | Telepen Alpha -34 | UPC-A -35 | UPC-A + Check Digit -37 | UPC-E -38 | UPC-E + Check Digit -40 | POSTNET -47 | MSI Plessey -49 | FIM -50 | LOGMARS -51 | Pharmacode One-Track -52 | PZN -53 | Pharmacode Two-Track -55 | PDF417 -56 | Compact PDF417 (Truncated PDF417) -57 | MaxiCode -58 | QR Code -60 | Code 128 (Subset B) -63 | Australia Post Standard Customer -66 | Australia Post Reply Paid -67 | Australia Post Routing -68 | Australia Post Redirection -69 | ISBN (EAN-13 with verification stage) -70 | Royal Mail 4 State (RM4SCC) -71 | Data Matrix (ECC200) -72 | EAN-14 -73 | Vehicle Identification Number -74 | Codablock-F -75 | NVE-18 (SSCC-18) -76 | Japanese Postal Code -77 | Korea Post -79 | GS1 DataBar Stacked (stacked version of GS1 DataBar Truncated) -80 | GS1 DataBar Stacked Omnidirectional -81 | GS1 DataBar Expanded Stacked -82 | PLANET -84 | MicroPDF417 -85 | USPS Intelligent Mail (OneCode) -86 | Plessey Code -87 | Telepen Numeric -89 | ITF-14 -90 | Dutch Post KIX Code -92 | Aztec Code -93 | DAFT Code -96 | DPD Code -97 | Micro QR Code -98 | HIBC Code 128 -99 | HIBC Code 39 -102 | HIBC Data Matrix ECC200 -104 | HIBC QR Code -106 | HIBC PDF417 -108 | HIBC MicroPDF417 -110 | HIBC Codablock-F -112 | HIBC Aztec Code -115 | DotCode -116 | Han Xin (Chinese Sensible) Code -121 | Royal Mail 4-state Mailmark -128 | Aztec Runes -129 | Code 32 -130 | Composite Symbol with EAN linear component -131 | Composite Symbol with GS1-128 linear component -132 | Composite Symbol with GS1 DataBar Omnidirectional linear - | component -133 | Composite Symbol with GS1 DataBar Limited linear component -134 | Composite Symbol with GS1 DataBar Expanded linear component -135 | Composite Symbol with UPC-A linear component -136 | Composite Symbol with UPC-E linear component -137 | Composite Symbol with GS1 DataBar Stacked component -138 | Composite Symbol with GS1 DataBar Stacked Omnidirectional - | component -139 | Composite Symbol with GS1 DataBar Expanded Stacked component -140 | Channel Code -141 | Code One -142 | Grid Matrix -143 | UPNQR (Univerzalnega Plačilnega Naloga QR) -144 | Ultracode -145 | Rectangular Micro QR Code (rMQR) +1 | CODE11 | Code 11 +2 | C25STANDARD | Standard Code 2 of 5 +3 | C25INTER | Interleaved 2 of 5 +4 | C25IATA | Code 2 of 5 IATA +6 | C25LOGIC | Code 2 of 5 Data Logic +7 | C25IND | Code 2 of 5 Industrial +8 | CODE39 | Code 3 of 9 (Code 39) +9 | EXCODE39 | Extended Code 3 of 9 (Code 39+) +13 | EANX | EAN (including EAN-8 and EAN-13) +14 | EANX_CHK | EAN + Check Digit +16 | GS1_128 | GS1-128 (UCC.EAN-128) +18 | CODABAR | Codabar +20 | CODE128 | Code 128 (automatic subset switching) +21 | DPLEIT | Deutshe Post Leitcode +22 | DPIDENT | Deutshe Post Identcode +23 | CODE16K | Code 16K +24 | CODE49 | Code 49 +25 | CODE93 | Code 93 +28 | FLAT | Flattermarken +29 | DBAR_OMN | GS1 DataBar Omnidirectional (including GS1 + | | DataBar Truncated) +30 | DBAR_LTD | GS1 DataBar Limited +31 | DBAR_EXP | GS1 DataBar Expanded +32 | TELEPEN | Telepen Alpha +34 | UPCA | UPC-A +35 | UPCA_CHK | UPC-A + Check Digit +37 | UPCE | UPC-E +38 | UPCE_CHK | UPC-E + Check Digit +40 | POSTNET | POSTNET +47 | MSI_PLESSEY | MSI Plessey +49 | FIM | FIM +50 | LOGMARS | LOGMARS +51 | PHARMA | Pharmacode One-Track +52 | PZN | PZN +53 | PHARMA_TWO | Pharmacode Two-Track +55 | PDF417 | PDF417 +56 | PDF417COMP | Compact PDF417 (Truncated PDF417) +57 | MAXICODE | MaxiCode +58 | QRCODE | QR Code +60 | CODE128B | Code 128 (Subset B) +63 | AUSPOST | Australia Post Standard Customer +66 | AUSREPLY | Australia Post Reply Paid +67 | AUSROUTE | Australia Post Routing +68 | AUSREDIRECT | Australia Post Redirection +69 | ISBNX | ISBN (EAN-13 with verification stage) +70 | RM4SCC | Royal Mail 4 State (RM4SCC) +71 | DATAMATRIX | Data Matrix (ECC200) +72 | EAN14 | EAN-14 +73 | VIN | Vehicle Identification Number +74 | CODABLOCKF | Codablock-F +75 | NVE18 | NVE-18 (SSCC-18) +76 | JAPANPOST | Japanese Postal Code +77 | KOREAPOST | Korea Post +79 | DBAR_STK | GS1 DataBar Stacked (stacked version of GS1 + | | DataBar Truncated) +80 | DBAR_OMNSTK | GS1 DataBar Stacked Omnidirectional +81 | DBAR_EXPSTK | GS1 DataBar Expanded Stacked +82 | PLANET | PLANET +84 | MICROPDF417 | MicroPDF417 +85 | USPS_IMAIL | USPS Intelligent Mail (OneCode) +86 | PLESSEY | Plessey Code +87 | TELEPEN_NUM | Telepen Numeric +89 | ITF14 | ITF-14 +90 | KIX | Dutch Post KIX Code +92 | AZTEC | Aztec Code +93 | DAFT | DAFT Code +96 | DPD | DPD Code +97 | MICROQR | Micro QR Code +98 | HIBC_128 | HIBC Code 128 +99 | HIBC_39 | HIBC Code 39 +102 | HIBC_DM | HIBC Data Matrix ECC200 +104 | HIBC_QR | HIBC QR Code +106 | HIBC_PDF | HIBC PDF417 +108 | HIBC_MICPDF | HIBC MicroPDF417 +110 | HIBC_BLOCKF | HIBC Codablock-F +112 | HIBC_AZTEC | HIBC Aztec Code +115 | DOTCODE | DotCode +116 | HANXIN | Han Xin (Chinese Sensible) Code +121 | MAILMARK | Royal Mail 4-state Mailmark +128 | AZRUNE | Aztec Runes +129 | CODE32 | Code 32 +130 | EANX_CC | Composite Symbol with EAN linear component +131 | GS1_128_CC | Composite Symbol with GS1-128 linear component +132 | DBAR_OMN_CC | Composite Symbol with GS1 DataBar Omnidirectional + | | linear component +133 | DBAR_LTD_CC | Composite Symbol with GS1 DataBar Limited linear + | | component +134 | DBAR_EXP_CC | Composite Symbol with GS1 DataBar Expanded linear + | | component +135 | UPCA_CC | Composite Symbol with UPC-A linear component +136 | UPCE_CC | Composite Symbol with UPC-E linear component +137 | DBAR_STK_CC | Composite Symbol with GS1 DataBar Stacked + | | component +138 | DBAR_OMNSTK_CC | Composite Symbol with GS1 DataBar Stacked + | | Omnidirectional component +139 | DBAR_EXPSTK_CC | Composite Symbol with GS1 DataBar Expanded + | | Stacked component +140 | CHANNEL | Channel Code +141 | CODEONE | Code One +142 | GRIDMATRIX | Grid Matrix +143 | UPNQR | UPNQR (Univerzalnega Plačilnega Naloga QR) +144 | ULTRA | Ultracode +145 | RMQR | Rectangular Micro QR Code (rMQR) -------------------------------------------------------------------------------- 4.4 Adjusting height @@ -566,6 +578,10 @@ zint -b 71 --square --scale 10 --eci 17 --esc -d "\xE2\x82\xAC" zint -b 71 --square --scale 10 --eci 17 --esc -d "\u20AC" +and to the command: + +zint -b 71 --square --scale 10 --eci 17 -d "€" + Ex2: The Chinese character with Unicode codepoint U+5E38 can be encoded in Big5 encoding. The Big5 representation of this character is the two hex bytes: B1 60 (contained in the file big5char.txt). The generation command for Data Matrix is: @@ -576,10 +592,12 @@ This is equivalent to the command (using the --esc switch): zint -b 71 --square --scale 10 --eci 28 --binary --esc -d "\xB1\x60" -and to the command (no --binary switch so conversion occurs): +and to the commands (no --binary switch so conversion occurs): zint -b 71 --square --scale 10 --eci 28 --esc -d "\u5E38" +zint -b 71 --square --scale 10 --eci 28 -d "常" + Ex3: Some decoders (in particular mobile app ones) for QR Code assume UTF-8 encoding by default and do not support ECI. In this case supply UTF-8 data and use the --binary switch so that the data will be encoded as UTF-8 without @@ -685,7 +703,7 @@ command line. The -h or --help option will display a list of all of the valid options available, and also gives the exact version of the software. The -t or --types option gives the table of symbologies along with the symbol -ID numbers. +ID numbers and names. The -e or --ecinos option gives a list of the ECI codes. @@ -1393,7 +1411,7 @@ EAN-2 and EAN-5 add-on symbols can be added using the + character. For example, to draw a UPC-A symbol with the data 72527270270 with an EAN-5 add-on showing the data 12345 use the command: -zint --barcode=34 -d 72527270270+12345 +zint --barcode=UPCA -d 72527270270+12345 or encode a data string with the + character included: @@ -1418,7 +1436,7 @@ character as with UPC-A. In addition Zint also supports Number System 1 encoding by entering a 7-digit article number stating with the digit 1. For example: -zint --barcode=37 -d 1123456 +zint --barcode=UPCE -d 1123456 or @@ -1444,11 +1462,11 @@ numbers respectively. Zint will decide which symbology to use depending on the length of the input data. In addition EAN-2 and EAN-5 add-on symbols can be added using the + symbol as with UPC symbols. For example: -zint --barcode=13 -d 54321 +zint --barcode=EANX -d 54321 will encode a stand-alone EAN-5, whereas -zint --barcode=13 -d 7432365+54321 +zint --barcode=EANX -d 7432365+54321 will encode an EAN-8 symbol with an EAN-5 add-on. As before these results can be achieved using the API: @@ -1865,7 +1883,7 @@ entered into a primary string with the data for the 2D component being entered in the normal way. To do this at the command prompt use the --primary= command. For example: -zint -b 130 --mode=1 --primary=331234567890 -d "[99]1234-abcd" +zint -b EANX_CC --mode=1 --primary=331234567890 -d "[99]1234-abcd" This creates an EAN-13 linear component with the data "331234567890" and a 2D CC-A (see below) component with the data "(99)1234-abcd". The same results can diff --git a/frontend/main.c b/frontend/main.c index e83a4659..815e3665 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -2,7 +2,7 @@ /* libzint - the open source barcode library - Copyright (C) 2008-2020 Robin Stuart + Copyright (C) 2008-2021 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 @@ -32,46 +32,60 @@ #include "zint.h" #endif -#define NESET "0123456789" - #ifndef ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif /* Print list of supported symbologies */ static void types(void) { - printf( " 1: Code 11 52: PZN 96: DPD Code\n" - " 2: Standard 2of5 53: Pharma Two-Track 97: Micro QR Code\n" - " 3: Interleaved 2of5 55: PDF417 98: HIBC Code 128\n" - " 4: IATA 2of5 56: Compact PDF417 99: HIBC Code 39\n" - " 6: Data Logic 57: MaxiCode 102: HIBC Data Matrix\n" - " 7: Industrial 2of5 58: QR Code 104: HIBC QR Code\n" - " 8: Code 39 60: Code 128-B 106: HIBC PDF417\n" - " 9: Extended Code 39 63: AP Standard Customer 108: HIBC MicroPDF417\n" - "13: EAN 66: AP Reply Paid 110: HIBC Codablock-F\n" - "14: EAN + Check 67: AP Routing 112: HIBC Aztec Code\n" - "16: GS1-128 68: AP Redirection 115: DotCode\n" - "18: Codabar 69: ISBN 116: Han Xin Code\n" - "20: Code 128 70: RM4SCC 121: RM Mailmark\n" - "21: Leitcode 71: Data Matrix 128: Aztec Runes\n" - "22: Identcode 72: EAN-14 129: Code 32\n" - "23: Code 16k 73: VIN 130: Comp EAN\n" - "24: Code 49 74: Codablock-F 131: Comp GS1-128\n" - "25: Code 93 75: NVE-18 132: Comp DataBar Omni\n" - "28: Flattermarken 76: Japanese Post 133: Comp DataBar Ltd\n" - "29: GS1 DataBar Omni 77: Korea Post 134: Comp DataBar Exp\n" - "30: GS1 DataBar Ltd 79: GS1 DataBar Stack 135: Comp UPC-A\n" - "31: GS1 DataBar Exp 80: GS1 DataBar Stack Omni 136: Comp UPC-E\n" - "32: Telepen Alpha 81: GS1 DataBar Exp Stack 137: Comp DataBar Stack\n" - "34: UPC-A 82: PLANET 138: Comp DataBar Stack Omni\n" - "35: UPC-A + Check 84: MicroPDF 139: Comp DataBar Exp Stack\n" - "37: UPC-E 85: USPS Intelligent Mail 140: Channel Code\n" - "38: UPC-E + Check 86: UK Plessey 141: Code One\n" - "40: POSTNET 87: Telepen Numeric 142: Grid Matrix\n" - "47: MSI Plessey 89: ITF-14 143: UPNQR\n" - "49: FIM 90: KIX Code 144: Ultracode\n" - "50: Logmars 92: Aztec Code 145: rMQR\n" - "51: Pharma One-Track 93: DAFT Code\n" + printf( " 1 CODE11 Code 11 74 CODABLOCKF Codablock-F\n" + " 2 C25STANDARD Standard 2of5 75 NVE18 NVE-18\n" + " 3 C25INTER Interleaved 2of5 76 JAPANPOST Japanese Post\n" + " 4 C25IATA IATA 2of5 77 KOREAPOST Korea Post\n" + " 6 C25LOGIC Data Logic 2of5 79 DBAR_STK DataBar Stacked\n" + " 7 C25IND Industrial 2of5 80 DBAR_OMNSTK DataBar Stacked Omni\n" + " 8 CODE39 Code 39 81 DBAR_EXPSTK DataBar Expanded Stack\n" + " 9 EXCODE39 Extended Code 39 82 PLANET USPS PLANET\n" + "13 EANX EAN 84 MICROPDF417 MicroPDF417\n" + "14 EANX_CHK EAN + Check Digit 85 USPS_IMAIL USPS Intelligent Mail\n" + "16 GS1_128 GS1-128 86 PLESSEY UK Plessey\n" + "18 CODABAR Codabar 87 TELEPEN_NUM Telepen Numeric\n" + "20 CODE128 Code 128 89 ITF14 ITF-14\n" + "21 DPLEIT Deutsche Post Leitcode 90 KIX Dutch Post KIX Code\n" + "22 DPIDENT Deutsche Post Identcode 92 AZTEC Aztec Code\n" + "23 CODE16K Code 16k 93 DAFT DAFT Code\n" + "24 CODE49 Code 49 96 DPD DPD Parcel Code 128\n" + "25 CODE93 Code 93 97 MICROQR Micro QR Code\n" + "28 FLAT Flattermarken 98 HIBC_128 HIBC Code 128\n" + "29 DBAR_OMN DataBar Omnidirectional 99 HIBC_39 HIBC Code 39\n" + "30 DBAR_LTD DataBar Limited 102 HIBC_DM HIBC Data Matrix\n" + "31 DBAR_EXP DataBar Expanded 104 HIBC_QR HIBC QR Code\n" + "32 TELEPEN Telepen Alpha 106 HIBC_PDF HIBC PDF417\n" + "34 UPCA UPC-A 108 HIBC_MICPDF HIBC MicroPDF417\n" + "35 UPCA_CHK UPC-A + Check Digit 110 HIBC_BLOCKF HIBC Codablock-F\n" + "37 UPCE UPC-E 112 HIBC_AZTEC HIBC Aztec Code\n" + "38 UPCE_CHK UPC-E + Check Digit 115 DOTCODE DotCode\n" + "40 POSTNET USPS POSTNET 116 HANXIN Han Xin Code\n" + "47 MSI_PLESSEY MSI Plessey 121 MAILMARK Royal Mail Mailmark\n" + "49 FIM Facing Ident Mark 128 AZRUNE Aztec Runes\n" + "50 LOGMARS LOGMARS Code 39 129 CODE32 Code 32\n" + "51 PHARMA Pharmacode One-Track 130 EANX_CC Composite EAN\n" + "52 PZN Pharmazentralnummer 131 GS1_128_CC Composite GS1-128\n" + "53 PHARMA_TWO Pharmacode Two-Track 132 DBAR_OMN_CC Comp DataBar Omni\n" + "55 PDF417 PDF417 133 DBAR_LTD_CC Comp DataBar Limited\n" + "56 PDF417COMP Compact PDF417 134 DBAR_EXP_CC Comp DataBar Expanded\n" + "57 MAXICODE MaxiCode 135 UPCA_CC Composite UPC-A\n" + "58 QRCODE QR Code 136 UPCE_CC Composite UPC-E\n" + "60 CODE128B Code 128 (Subset B) 137 DBAR_STK_CC Comp DataBar Stacked\n" + "63 AUSPOST AP Standard Customer 138 DBAR_OMNSTK_CC Comp DataBar Stack Omn\n" + "66 AUSREPLY AP Reply Paid 139 DBAR_EXPSTK_CC Comp DataBar Exp Stack\n" + "67 AUSROUTE AP Routing 140 CHANNEL Channel Code\n" + "68 AUSREDIRECT AP Redirection 141 CODEONE Code One\n" + "69 ISBNX ISBN 142 GRIDMATRIX Grid Matrix\n" + "70 RM4SCC Royal Mail 4SCC 143 UPNQR UPN QR Code\n" + "71 DATAMATRIX Data Matrix 144 ULTRA Ultracode\n" + "72 EAN14 EAN-14 145 RMQR Rectangular Micro QR\n" + "73 VIN Vehicle Information\n" ); } @@ -95,7 +109,7 @@ static void usage(void) { } printf( "Encode input data in a barcode and save as BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT\n\n" - " -b, --barcode=NUMBER Number of barcode type. Default is 20 (Code 128)\n" + " -b, --barcode=TYPE Number or name of barcode type. Default is 20 (CODE128)\n" " --addongap=NUMBER Set add-on gap in multiples of X-dimension for UPC/EAN\n" " --batch Treat each line of input file as a separate data set\n" " --bg=COLOUR Specify a background colour (in hex)\n" @@ -181,27 +195,26 @@ static void show_eci(void) { ); } -/* Verifies that a string only uses valid characters */ -static int validator(char test_string[], char source[]) { - unsigned int i, j; +/* Verifies that a string (length <= 9) only uses digits. On success returns value in arg */ +static int validate_int(const char source[], int *p_val) { + int val = 0; + int i; + int length = (int) strlen(source); - for (i = 0; i < strlen(source); i++) { - unsigned int latch = 0; - for (j = 0; j < strlen(test_string); j++) { - if (source[i] == test_string[j]) { - latch = 1; - } - } - if (!(latch)) { - return ZINT_ERROR_INVALID_DATA; + for (i = 0; i < length; i++) { + if (source[i] < '0' || source[i] > '9' || val < 0) { /* Neg test checks for overflow */ + return 0; } + val *= 10; + val += source[i] - '0'; } + *p_val = val; - return 0; + return 1; } /* Converts an integer value to its hexadecimal character */ -static char itoc(int source) { +static char itoc(const int source) { if ((source >= 0) && (source <= 9)) { return ('0' + source); } else { @@ -211,7 +224,7 @@ static char itoc(int source) { /* Converts upper case characters to lower case in a string source[] */ static void to_lower(char source[]) { - int i, src_len = strlen(source); + int i, src_len = (int) strlen(source); for (i = 0; i < src_len; i++) { if ((source[i] >= 'A') && (source[i] <= 'Z')) { @@ -220,18 +233,181 @@ static void to_lower(char source[]) { } } -static char *filetypes[] = { - "bmp", "emf", "eps", "gif", "pcx", "png", "svg", "tif", "txt", // TODO: Determine if PNG available -}; +/* Return symbology id if `barcode_name` a barcode name */ +static int get_barcode_name(const char *barcode_name) { + struct name { const int symbology; const char *n; }; + static const struct name names[] = { /* Must be sorted for binary search to work */ + { BARCODE_AUSPOST, "auspost" }, + { BARCODE_AUSREDIRECT, "ausredirect" }, + { BARCODE_AUSREPLY, "ausreply" }, + { BARCODE_AUSROUTE, "ausroute" }, + { BARCODE_AZRUNE, "azrune" }, + { BARCODE_AZTEC, "aztec" }, + { BARCODE_AZRUNE, "aztecrune" }, /* Synonym */ + { BARCODE_AZRUNE, "aztecrunes" }, /* Synonym */ + { BARCODE_C25IATA, "c25iata" }, + { BARCODE_C25IND, "c25ind" }, + { BARCODE_C25INTER, "c25inter" }, + { BARCODE_C25LOGIC, "c25logic" }, + { BARCODE_C25STANDARD, "c25standard" }, + { BARCODE_CHANNEL, "channel" }, + { BARCODE_CODABAR, "codabar" }, + { BARCODE_CODABLOCKF, "codablockf" }, + { BARCODE_CODE11, "code11" }, + { BARCODE_CODE128, "code128" }, + { BARCODE_CODE128B, "code128b" }, + { BARCODE_CODE16K, "code16k" }, + { BARCODE_CODE32, "code32" }, + { BARCODE_CODE39, "code39" }, + { BARCODE_CODE49, "code49" }, + { BARCODE_CODE93, "code93" }, + { BARCODE_CODEONE, "codeone" }, + { BARCODE_DAFT, "daft" }, + { BARCODE_DATAMATRIX, "datamatrix" }, + { BARCODE_DBAR_EXP, "dbarexp" }, + { BARCODE_DBAR_EXP_CC, "dbarexpcc" }, + { BARCODE_DBAR_EXPSTK, "dbarexpstk" }, + { BARCODE_DBAR_EXPSTK_CC, "dbarexpstkcc" }, + { BARCODE_DBAR_LTD, "dbarltd" }, + { BARCODE_DBAR_LTD_CC, "dbarltdcc" }, + { BARCODE_DBAR_OMN, "dbaromn" }, + { BARCODE_DBAR_OMN_CC, "dbaromncc" }, + { BARCODE_DBAR_OMNSTK, "dbaromnstk" }, + { BARCODE_DBAR_OMNSTK_CC, "dbaromnstkcc" }, + { BARCODE_DBAR_STK, "dbarstk" }, + { BARCODE_DBAR_STK_CC, "dbarstkcc" }, + { BARCODE_DOTCODE, "dotcode" }, + { BARCODE_DPD, "dpd" }, + { BARCODE_DPIDENT, "dpident" }, + { BARCODE_DPLEIT, "dpleit" }, + { BARCODE_EAN14, "ean14" }, + { BARCODE_EANX, "eanx" }, + { BARCODE_EANX_CC, "eanxcc" }, + { BARCODE_EANX_CHK, "eanxchk" }, + { BARCODE_EXCODE39, "excode39" }, + { BARCODE_FIM, "fim" }, + { BARCODE_FLAT, "flat" }, + { BARCODE_GRIDMATRIX, "gridmatrix" }, + { BARCODE_GS1_128, "gs1128" }, + { BARCODE_GS1_128_CC, "gs1128cc" }, + { BARCODE_HANXIN, "hanxin" }, + { BARCODE_HIBC_128, "hibc128" }, + { BARCODE_HIBC_39, "hibc39" }, + { BARCODE_HIBC_AZTEC, "hibcaztec" }, + { BARCODE_HIBC_BLOCKF, "hibcblockf" }, + { BARCODE_HIBC_BLOCKF, "hibccodablockf" }, /* Synonym */ + { BARCODE_HIBC_128, "hibccode128" }, /* Synonym */ + { BARCODE_HIBC_39, "hibccode39" }, /* Synonym */ + { BARCODE_HIBC_DM, "hibcdatamatrix" }, /* Synonym */ + { BARCODE_HIBC_DM, "hibcdm" }, + { BARCODE_HIBC_MICPDF, "hibcmicpdf" }, + { BARCODE_HIBC_MICPDF, "hibcmicropdf" }, /* Synonym */ + { BARCODE_HIBC_MICPDF, "hibcmicropdf417" }, /* Synonym */ + { BARCODE_HIBC_PDF, "hibcpdf" }, + { BARCODE_HIBC_PDF, "hibcpdf417" }, /* Synonym */ + { BARCODE_HIBC_QR, "hibcqr" }, + { BARCODE_HIBC_QR, "hibcqrcode" }, /* Synonym */ + { BARCODE_ISBNX, "isbnx" }, + { BARCODE_ITF14, "itf14" }, + { BARCODE_JAPANPOST, "japanpost" }, + { BARCODE_KIX, "kix" }, + { BARCODE_KOREAPOST, "koreapost" }, + { BARCODE_LOGMARS, "logmars" }, + { BARCODE_MAILMARK, "mailmark" }, + { BARCODE_MAXICODE, "maxicode" }, + { BARCODE_MICROPDF417, "micropdf417" }, + { BARCODE_MICROQR, "microqr" }, + { BARCODE_MSI_PLESSEY, "msiplessey" }, + { BARCODE_NVE18, "nve18" }, + { BARCODE_PDF417, "pdf417" }, + { BARCODE_PDF417COMP, "pdf417comp" }, + { BARCODE_PHARMA, "pharma" }, + { BARCODE_PHARMA_TWO, "pharmatwo" }, + { BARCODE_PLANET, "planet" }, + { BARCODE_PLESSEY, "plessey" }, + { BARCODE_POSTNET, "postnet" }, + { BARCODE_PZN, "pzn" }, + { BARCODE_QRCODE, "qr" }, /* Synonym */ + { BARCODE_QRCODE, "qrcode" }, + { BARCODE_RM4SCC, "rm4scc" }, + { BARCODE_RMQR, "rmqr" }, + { BARCODE_TELEPEN, "telepen" }, + { BARCODE_TELEPEN_NUM, "telepennum" }, + { BARCODE_ULTRA, "ultra" }, + { BARCODE_ULTRA, "ultracode" }, /* Synonym */ + { BARCODE_UPCA, "upca" }, + { BARCODE_UPCA_CC, "upcacc" }, + { BARCODE_UPCA_CHK, "upcachk" }, + { BARCODE_UPCE, "upce" }, + { BARCODE_UPCE_CC, "upcecc" }, + { BARCODE_UPCE_CHK, "upcechk" }, + { BARCODE_UPNQR, "upnqr" }, + { BARCODE_UPNQR, "upnqrcode" }, /* Synonym */ + { BARCODE_USPS_IMAIL, "uspsimail" }, + { BARCODE_VIN, "vin" }, + }; + int s = 0, e = ARRAY_SIZE(names) - 1; -/* Whether `filetype` supported by Zint */ -static int supported_filetype(char *filetype) { + char n[30] = {0}; + int i, j, length; + + /* Ignore case and any "BARCODE" prefix */ + strncpy(n, barcode_name, 29); + to_lower(n); + length = (int) strlen(n); + if (strncmp(n, "barcode", 7) == 0) { + memmove(n, n + 7, length - 7 + 1); /* Include NUL char */ + length = (int) strlen(n); + } + + /* Ignore any non-alphanumeric characters */ + for (i = 0, j = 0; i < length; i++) { + if ((n[i] >= 'a' && n[i] <= 'z') || (n[i] >= '0' && n[i] <= '9')) { + n[j++] = n[i]; + } + } + if (j == 0) { + return 0; + } + n[j] = '\0'; + + while (s <= e) { + int m = (s + e) / 2; + int cmp = strcmp(names[m].n, n); + if (cmp == 0) { + return names[m].symbology; + } + if (cmp < 0) { + s = m + 1; + } else { + e = m - 1; + } + } + + return 0; +} + +/* Whether `filetype` supported by Zint. Sets `png_refused` if `no_png` and PNG requested */ +static int supported_filetype(const char *filetype, const int no_png, int *png_refused) { + static const char *filetypes[] = { + "bmp", "emf", "eps", "gif", "pcx", "png", "svg", "tif", "txt", + }; char lc_filetype[4] = {0}; int i; + if (png_refused) { + *png_refused = 0; + } strncpy(lc_filetype, filetype, 3); to_lower(lc_filetype); + if (no_png && strcmp(lc_filetype, "png") == 0) { + if (png_refused) { + *png_refused = 1; + } + return 0; + } + for (i = 0; i < (int) ARRAY_SIZE(filetypes); i++) { if (strcmp(lc_filetype, filetypes[i]) == 0) { return 1; @@ -241,7 +417,7 @@ static int supported_filetype(char *filetype) { } /* Get file extension, excluding those of 4 or more letters */ -static char *get_extension(char *file) { +static char *get_extension(const char *file) { char *dot; dot = strrchr(file, '.'); @@ -253,7 +429,7 @@ static char *get_extension(char *file) { /* Set extension of `file` to `filetype`, replacing existing extension if any. * Does nothing if file already has `filetype` extension */ -static void set_extension(char *file, char *filetype) { +static void set_extension(char *file, const char *filetype) { char lc_filetype[4] = {0}; char *extension; char lc_extension[4]; @@ -277,17 +453,24 @@ static void set_extension(char *file, char *filetype) { strncat(file, filetype, 3); } -static char *raster_filetypes[] = { - "bmp", "gif", "pcx", "png", "tif", // TODO: Determine if PNG available -}; - -static int is_raster(char *filetype) { +/* Whether `filetype` is raster type */ +static int is_raster(const char *filetype, const int no_png) { + static const char *raster_filetypes[] = { + "bmp", "gif", "pcx", "png", "tif", + }; int i; char lc_filetype[4] = {0}; + if (filetype == NULL) { + return 0; + } strcpy(lc_filetype, filetype); to_lower(lc_filetype); + if (no_png && strcmp(lc_filetype, "png") == 0) { + return 0; + } + for (i = 0; i < (int) ARRAY_SIZE(raster_filetypes); i++) { if (strcmp(lc_filetype, raster_filetypes[i]) == 0) { return 1; @@ -296,7 +479,9 @@ static int is_raster(char *filetype) { return 0; } -static int batch_process(struct zint_symbol *symbol, char *filename, int mirror_mode, char *filetype, int rotate_angle) { +/* Batch mode - output symbol for each line of text in `filename` */ +static int batch_process(struct zint_symbol *symbol, const char *filename, const int mirror_mode, + const char *filetype, const int rotate_angle) { FILE *file; unsigned char buffer[ZINT_MAX_DATA_LEN] = {0}; // Maximum HanXin input unsigned char character = 0; @@ -358,7 +543,7 @@ static int batch_process(struct zint_symbol *symbol, char *filename, int mirror_ reverse_number[i] = number[inpos - i - 1]; } - format_len = strlen(format_string); + format_len = (int) strlen(format_string); for (i = format_len; i > 0; i--) { format_char = format_string[i - 1]; @@ -477,6 +662,76 @@ static int batch_process(struct zint_symbol *symbol, char *filename, int mirror_ return error_number; } +/* Stuff to convert args on Windows command line to UTF-8 */ +#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(_MSC_VER) +#define ZINT_WIN +#include +#include +#ifndef WC_ERR_INVALID_CHARS +#define WC_ERR_INVALID_CHARS 0x00000080 +#endif + +static int win_argc = 0; +static char **win_argv = NULL; + +/* Free Windows args */ +static void win_free_args() { + int i; + if (!win_argv) { + return; + } + for (i = 0; i < win_argc; i++) { + if (!win_argv[i]) { + break; + } + free(win_argv[i]); + win_argv[i] = NULL; + } + free(win_argv); + win_argv = NULL; +} + +/* For Windows replace args with UTF-8 versions */ +static void win_args(int *p_argc, char ***p_argv) { + int i; + LPWSTR *szArgList = CommandLineToArgvW(GetCommandLineW(), &win_argc); + if (szArgList) { + if (!(win_argv = (char **) calloc(win_argc + 1, sizeof(char *)))) { + LocalFree(szArgList); + } else { + for (i = 0; i < win_argc; i++) { + int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, szArgList[i], -1, NULL, 0, NULL, NULL); + if (len == 0 || !(win_argv[i] = malloc(len + 1))) { + win_free_args(); + LocalFree(szArgList); + return; + } + if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, szArgList[i], -1, win_argv[i], len, NULL, NULL) + == 0) { + win_free_args(); + LocalFree(szArgList); + return; + } + } + for (i = 0; i < win_argc; i++) { + (*p_argv)[i] = win_argv[i]; + } + *p_argc = win_argc; + LocalFree(szArgList); + } + } +} +#endif + +/* Helper to free Windows args on exit */ +static int do_exit(int error_number) { +#ifdef ZINT_WIN + win_free_args(); +#endif + exit(error_number); + return error_number; /* Not reached */ +} + typedef struct { char *arg; int opt; } arg_opt; int main(int argc, char **argv) { @@ -491,9 +746,11 @@ int main(int argc, char **argv) { int fullmultibyte = 0; int mask = 0; int separator = 0; - int scmvv = -1; int addon_gap = 0; char filetype[4] = {0}; + int no_png; + int png_refused; + int val; int i; int ret; char *outfile_extension; @@ -504,391 +761,398 @@ int main(int argc, char **argv) { arg_opt *arg_opts = (arg_opt *) _alloca(argc * sizeof(arg_opt)); #endif - my_symbol = ZBarcode_Create(); - my_symbol->input_mode = UNICODE_MODE; - if (argc == 1) { usage(); exit(1); } + my_symbol = ZBarcode_Create(); + if (!my_symbol) { + fprintf(stderr, "Error 151: Memory failure\n"); + exit(1); + } + no_png = strcmp(my_symbol->outfile, "out.gif") == 0; + my_symbol->input_mode = UNICODE_MODE; + +#ifdef ZINT_WIN + win_args(&argc, &argv); +#endif + while (1) { + enum options { + OPT_ADDONGAP = 128, OPT_BATCH, OPT_BINARY, OPT_BG, OPT_BIND, OPT_BOLD, OPT_BORDER, + OPT_BOX, OPT_CMYK, OPT_COLS, OPT_DIRECT, OPT_DMRE, OPT_DOTSIZE, OPT_DOTTY, OPT_DUMP, + OPT_ECI, OPT_ESC, OPT_FG, OPT_FILETYPE, OPT_FONTSIZE, OPT_FULLMULTIBYTE, + OPT_GS1, OPT_GSSEP, OPT_HEIGHT, OPT_INIT, OPT_MIRROR, OPT_MASK, OPT_MODE, + OPT_NOBACKGROUND, OPT_NOTEXT, OPT_PRIMARY, OPT_ROTATE, OPT_ROWS, OPT_SCALE, + OPT_SCMVV, OPT_SECURE, OPT_SEPARATOR, OPT_SMALL, OPT_SQUARE, OPT_VERBOSE, OPT_VERS, + OPT_WERROR, OPT_WZPL, + }; int option_index = 0; static struct option long_options[] = { - {"addongap", 1, 0, 0}, - {"barcode", 1, 0, 'b'}, - {"batch", 0, 0, 0}, - {"binary", 0, 0, 0}, - {"bg", 1, 0, 0}, - {"bind", 0, 0, 0}, - {"bold", 0, 0, 0}, - {"border", 1, 0, 0}, - {"box", 0, 0, 0}, - {"cmyk", 0, 0, 0}, - {"cols", 1, 0, 0}, - {"data", 1, 0, 'd'}, - {"direct", 0, 0, 0}, - {"dmre", 0, 0, 0}, - {"dotsize", 1, 0, 0}, - {"dotty", 0, 0, 0}, - {"dump", 0, 0, 0}, - {"eci", 1, 0, 0}, - {"ecinos", 0, 0, 'e'}, - {"esc", 0, 0, 0}, - {"fg", 1, 0, 0}, - {"filetype", 1, 0, 0}, - {"fontsize", 1, 0, 0}, - {"fullmultibyte", 0, 0, 0}, - {"gs1", 0, 0, 0}, - {"gssep", 0, 0, 0}, - {"height", 1, 0, 0}, - {"help", 0, 0, 'h'}, - {"init", 0, 0, 0}, - {"input", 1, 0, 'i'}, - {"mirror", 0, 0, 0}, - {"mask", 1, 0, 0}, - {"mode", 1, 0, 0}, - {"nobackground", 0, 0, 0}, - {"notext", 0, 0, 0}, - {"output", 1, 0, 'o'}, - {"primary", 1, 0, 0}, - {"reverse", 0, 0, 'r'}, - {"rotate", 1, 0, 0}, - {"rows", 1, 0, 0}, - {"scale", 1, 0, 0}, - {"scmvv", 1, 0, 0}, - {"secure", 1, 0, 0}, - {"separator", 1, 0, 0}, - {"small", 0, 0, 0}, - {"square", 0, 0, 0}, - {"types", 0, 0, 't'}, - {"verbose", 0, 0, 0}, // Currently undocumented, output some debug info - {"vers", 1, 0, 0}, - {"whitesp", 1, 0, 'w'}, - {0, 0, 0, 0} + {"addongap", 1, NULL, OPT_ADDONGAP}, + {"barcode", 1, NULL, 'b'}, + {"batch", 0, NULL, OPT_BATCH}, + {"binary", 0, NULL, OPT_BINARY}, + {"bg", 1, 0, OPT_BG}, + {"bind", 0, NULL, OPT_BIND}, + {"bold", 0, NULL, OPT_BOLD}, + {"border", 1, NULL, OPT_BORDER}, + {"box", 0, NULL, OPT_BOX}, + {"cmyk", 0, NULL, OPT_CMYK}, + {"cols", 1, NULL, OPT_COLS}, + {"data", 1, NULL, 'd'}, + {"direct", 0, NULL, OPT_DIRECT}, + {"dmre", 0, NULL, OPT_DMRE}, + {"dotsize", 1, NULL, OPT_DOTSIZE}, + {"dotty", 0, NULL, OPT_DOTTY}, + {"dump", 0, NULL, OPT_DUMP}, + {"eci", 1, NULL, OPT_ECI}, + {"ecinos", 0, NULL, 'e'}, + {"esc", 0, NULL, OPT_ESC}, + {"fg", 1, 0, OPT_FG}, + {"filetype", 1, NULL, OPT_FILETYPE}, + {"fontsize", 1, NULL, OPT_FONTSIZE}, + {"fullmultibyte", 0, NULL, OPT_FULLMULTIBYTE}, + {"gs1", 0, 0, OPT_GS1}, + {"gssep", 0, NULL, OPT_GSSEP}, + {"height", 1, NULL, OPT_HEIGHT}, + {"help", 0, NULL, 'h'}, + {"init", 0, NULL, OPT_INIT}, + {"input", 1, NULL, 'i'}, + {"mirror", 0, NULL, OPT_MIRROR}, + {"mask", 1, NULL, OPT_MASK}, + {"mode", 1, NULL, OPT_MODE}, + {"nobackground", 0, NULL, OPT_NOBACKGROUND}, + {"notext", 0, NULL, OPT_NOTEXT}, + {"output", 1, NULL, 'o'}, + {"primary", 1, NULL, OPT_PRIMARY}, + {"reverse", 0, NULL, 'r'}, + {"rotate", 1, NULL, OPT_ROTATE}, + {"rows", 1, NULL, OPT_ROWS}, + {"scale", 1, NULL, OPT_SCALE}, + {"scmvv", 1, NULL, OPT_SCMVV}, + {"secure", 1, NULL, OPT_SECURE}, + {"separator", 1, NULL, OPT_SEPARATOR}, + {"small", 0, NULL, OPT_SMALL}, + {"square", 0, NULL, OPT_SQUARE}, + {"types", 0, NULL, 't'}, + {"verbose", 0, NULL, OPT_VERBOSE}, // Currently undocumented, output some debug info + {"vers", 1, NULL, OPT_VERS}, + {"werror", 0, NULL, OPT_WERROR}, + {"whitesp", 1, NULL, 'w'}, + {"wzpl", 0, NULL, OPT_WZPL}, + {NULL, 0, NULL, 0} }; int c = getopt_long(argc, argv, "b:d:ehi:o:rtw:", long_options, &option_index); if (c == -1) break; switch (c) { - case 0: - if (!strcmp(long_options[option_index].name, "bind")) { - my_symbol->output_options += BARCODE_BIND; + case OPT_ADDONGAP: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 139: Invalid add-on gap value\n"); + return do_exit(1); } - if (!strcmp(long_options[option_index].name, "box")) { - my_symbol->output_options += BARCODE_BOX; + if (val >= 7 && val <= 12) { + addon_gap = val; + } else { + fprintf(stderr, "Warning 140: Invalid add-on gap value\n"); + fflush(stderr); } - if (!strcmp(long_options[option_index].name, "init")) { - my_symbol->output_options += READER_INIT; + break; + case OPT_BATCH: + if (data_cnt == 0) { + /* Switch to batch processing mode */ + batch_mode = 1; + } else { + fprintf(stderr, "Warning 141: Can't use batch mode if data given, ignoring\n"); + fflush(stderr); } - if (!strcmp(long_options[option_index].name, "small")) { - my_symbol->output_options += SMALL_TEXT; + break; + case OPT_BG: + strncpy(my_symbol->bgcolour, optarg, 9); + break; + case OPT_BINARY: + my_symbol->input_mode = (my_symbol->input_mode & ~0x07) | DATA_MODE; + break; + case OPT_BIND: + my_symbol->output_options |= BARCODE_BIND; + break; + case OPT_BOLD: + my_symbol->output_options |= BOLD_TEXT; + break; + case OPT_BORDER: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 107: Invalid border width value\n"); + return do_exit(1); } - if (!strcmp(long_options[option_index].name, "bold")) { - my_symbol->output_options += BOLD_TEXT; + if (val <= 1000) { /* `val` >= 0 always */ + my_symbol->border_width = val; + } else { + fprintf(stderr, "Warning 108: Border width out of range\n"); + fflush(stderr); } - if (!strcmp(long_options[option_index].name, "cmyk")) { - my_symbol->output_options += CMYK_COLOUR; + break; + case OPT_BOX: + my_symbol->output_options |= BARCODE_BOX; + break; + case OPT_CMYK: + my_symbol->output_options |= CMYK_COLOUR; + break; + case OPT_COLS: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 131: Invalid columns value\n"); + return do_exit(1); } - if (!strcmp(long_options[option_index].name, "dotty")) { - my_symbol->output_options += BARCODE_DOTTY_MODE; - } - if (!strcmp(long_options[option_index].name, "gssep")) { - my_symbol->output_options += GS1_GS_SEPARATOR; - } - if (!strcmp(long_options[option_index].name, "direct")) { - my_symbol->output_options += BARCODE_STDOUT; - } - if (!strcmp(long_options[option_index].name, "dump")) { - my_symbol->output_options += BARCODE_STDOUT; - strcpy(my_symbol->outfile, "dummy.txt"); - } - if (!strcmp(long_options[option_index].name, "gs1")) { - my_symbol->input_mode = (my_symbol->input_mode & ~0x07) | GS1_MODE; - } - if (!strcmp(long_options[option_index].name, "binary")) { - my_symbol->input_mode = (my_symbol->input_mode & ~0x07) | DATA_MODE; - } - if (!strcmp(long_options[option_index].name, "fg")) { - strncpy(my_symbol->fgcolour, optarg, 9); - } - if (!strcmp(long_options[option_index].name, "bg")) { - strncpy(my_symbol->bgcolour, optarg, 9); - } - if (!strcmp(long_options[option_index].name, "fullmultibyte")) { - fullmultibyte = 1; - } - if (!strcmp(long_options[option_index].name, "mask")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 148: Invalid mask value\n"); - exit(1); - } - mask = atoi(optarg) + 1; - if (mask <= 0 || mask > 8) { - /* Values >= 1 and <= 8 (i.e. mask pattern >= 0 and <= 7) only permitted */ - fprintf(stderr, "Warning 147: Invalid mask value\n"); - fflush(stderr); - mask = 0; - } - } - if (!strcmp(long_options[option_index].name, "notext")) { - my_symbol->show_hrt = 0; - } - if (!strcmp(long_options[option_index].name, "square")) { - my_symbol->option_3 = DM_SQUARE; + if ((val >= 1) && (val <= 67)) { + my_symbol->option_2 = val; + } else { + fprintf(stderr, "Warning 111: Number of columns out of range\n"); + fflush(stderr); } + break; + case OPT_DIRECT: + my_symbol->output_options |= BARCODE_STDOUT; + break; + case OPT_DMRE: /* Square overwrites DMRE */ - if (!strcmp(long_options[option_index].name, "dmre") - && my_symbol->option_3 != DM_SQUARE) { + if (my_symbol->option_3 != DM_SQUARE) { my_symbol->option_3 = DM_DMRE; } - if (!strcmp(long_options[option_index].name, "scale")) { - my_symbol->scale = (float) (atof(optarg)); - if (my_symbol->scale < 0.01f) { - /* Zero and negative values are not permitted */ - fprintf(stderr, "Warning 105: Invalid scale value\n"); - fflush(stderr); - my_symbol->scale = 1.0f; - } + break; + case OPT_DOTSIZE: + my_symbol->dot_size = (float) (atof(optarg)); + if (my_symbol->dot_size < 0.01f) { + /* Zero and negative values are not permitted */ + fprintf(stderr, "Warning 106: Invalid dot radius value\n"); + fflush(stderr); + my_symbol->dot_size = 4.0f / 5.0f; } - if (!strcmp(long_options[option_index].name, "scmvv")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 149: Invalid Structured Carrier Message version value\n"); - exit(1); - } - scmvv = atoi(optarg); - if (scmvv < 0 || scmvv > 99) { - /* Version 00-99 only */ - fprintf(stderr, "Warning 150: Invalid version (vv) for Structured Carrier Message, ignoring\n"); - fflush(stderr); - scmvv = -1; + break; + case OPT_DOTTY: + my_symbol->output_options |= BARCODE_DOTTY_MODE; + break; + case OPT_DUMP: + my_symbol->output_options |= BARCODE_STDOUT; + strcpy(my_symbol->outfile, "dummy.txt"); + break; + case OPT_ECI: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 138: Invalid ECI value\n"); + return do_exit(1); + } + if (val <= 999999) { /* `val` >= 0 always */ + my_symbol->eci = val; + } else { + fprintf(stderr, "Warning 118: Invalid ECI code\n"); + fflush(stderr); + } + break; + case OPT_ESC: + my_symbol->input_mode |= ESCAPE_MODE; + break; + case OPT_FG: + strncpy(my_symbol->fgcolour, optarg, 9); + break; + case OPT_FILETYPE: + /* Select the type of output file */ + if (!supported_filetype(optarg, no_png, &png_refused)) { + if (png_refused) { + fprintf(stderr, "Warning 152: PNG format disabled at compile time, ignoring\n"); } else { - my_symbol->option_2 = scmvv + 1; - } - } - if (!strcmp(long_options[option_index].name, "separator")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 128: Invalid separator value\n"); - exit(1); - } - separator = atoi(optarg); - if (separator < 0 || separator > 4) { - /* Negative and greater than 4 values are not permitted */ - fprintf(stderr, "Warning 127: Invalid separator value\n"); - fflush(stderr); - separator = 0; - } - } - if (!strcmp(long_options[option_index].name, "addongap")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 139: Invalid add-on gap value\n"); - exit(1); - } - addon_gap = atoi(optarg); - if (addon_gap < 7 || addon_gap > 12) { - fprintf(stderr, "Warning 140: Invalid add-on gap value\n"); - fflush(stderr); - addon_gap = 0; - } - } - if (!strcmp(long_options[option_index].name, "dotsize")) { - my_symbol->dot_size = (float) (atof(optarg)); - if (my_symbol->dot_size < 0.01f) { - /* Zero and negative values are not permitted */ - fprintf(stderr, "Warning 106: Invalid dot radius value\n"); - fflush(stderr); - my_symbol->dot_size = 4.0f / 5.0f; - } - } - if (!strcmp(long_options[option_index].name, "border")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 107: Invalid border width value\n"); - exit(1); - } - if ((atoi(optarg) >= 0) && (atoi(optarg) <= 1000)) { - my_symbol->border_width = atoi(optarg); - } else { - fprintf(stderr, "Warning 108: Border width out of range\n"); - fflush(stderr); - } - } - if (!strcmp(long_options[option_index].name, "height")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 109: Invalid symbol height value\n"); - exit(1); - } - if ((atoi(optarg) >= 1) && (atoi(optarg) <= 1000)) { - my_symbol->height = atoi(optarg); - } else { - fprintf(stderr, "Warning 110: Symbol height out of range\n"); - fflush(stderr); - } - } - if (!strcmp(long_options[option_index].name, "cols")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 131: Invalid columns value\n"); - exit(1); - } - if ((atoi(optarg) >= 1) && (atoi(optarg) <= 67)) { - my_symbol->option_2 = atoi(optarg); - } else { - fprintf(stderr, "Warning 111: Number of columns out of range\n"); - fflush(stderr); - } - } - if (!strcmp(long_options[option_index].name, "rows")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 132: Invalid rows value\n"); - exit(1); - } - if ((atoi(optarg) >= 1) && (atoi(optarg) <= 44)) { - my_symbol->option_1 = atoi(optarg); - } else { - fprintf(stderr, "Warning 112: Number of rows out of range\n"); - fflush(stderr); - } - } - if (!strcmp(long_options[option_index].name, "vers")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 133: Invalid version value\n"); - exit(1); - } - if ((atoi(optarg) >= 1) && (atoi(optarg) <= 84)) { - my_symbol->option_2 = atoi(optarg); - } else { - fprintf(stderr, "Warning 113: Invalid version\n"); - fflush(stderr); - } - } - if (!strcmp(long_options[option_index].name, "secure")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 134: Invalid ECC value\n"); - exit(1); - } - if ((atoi(optarg) >= 0) && (atoi(optarg) <= 8)) { - my_symbol->option_1 = atoi(optarg); - } else { - fprintf(stderr, "Warning 114: ECC level out of range\n"); - fflush(stderr); - } - } - if (!strcmp(long_options[option_index].name, "primary")) { - if (strlen(optarg) <= 127) { - strcpy(my_symbol->primary, optarg); - } else { - fprintf(stderr, "Error 115: Primary data string too long\n"); - fflush(stderr); - } - } - if (!strcmp(long_options[option_index].name, "mode")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 136: Invalid mode value\n"); - exit(1); - } - if ((atoi(optarg) >= 0) && (atoi(optarg) <= 6)) { - my_symbol->option_1 = atoi(optarg); - } else { - fprintf(stderr, "Warning 116: Invalid mode\n"); - fflush(stderr); - } - } - if (!strcmp(long_options[option_index].name, "rotate")) { - /* Only certain inputs allowed */ - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 117: Invalid rotation value\n"); - exit(1); - } - switch (atoi(optarg)) { - case 90: rotate_angle = 90; - break; - case 180: rotate_angle = 180; - break; - case 270: rotate_angle = 270; - break; - case 0: rotate_angle = 0; - break; - default: - fprintf(stderr, "Warning 137: Invalid rotation parameter\n"); - fflush(stderr); - break; - } - } - if (!strcmp(long_options[option_index].name, "batch")) { - if (data_cnt == 0) { - /* Switch to batch processing mode */ - batch_mode = 1; - } else { - fprintf(stderr, "Warning 141: Can't use batch mode if data given, ignoring\n"); - fflush(stderr); - } - } - if (!strcmp(long_options[option_index].name, "mirror")) { - /* Use filenames which reflect content */ - mirror_mode = 1; - } - if (!strcmp(long_options[option_index].name, "filetype")) { - /* Select the type of output file */ - if (!supported_filetype(optarg)) { fprintf(stderr, "Warning 142: File type '%s' not supported, ignoring\n", optarg); + } + fflush(stderr); + } else { + strncpy(filetype, optarg, (size_t) 3); + } + break; + case OPT_FONTSIZE: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 130: Invalid font size value\n"); + return do_exit(1); + } + if (val <= 100) { /* `val` >= 0 always */ + my_symbol->fontsize = val; + } else { + fprintf(stderr, "Warning 126: Invalid font size\n"); + fflush(stderr); + } + break; + case OPT_FULLMULTIBYTE: + fullmultibyte = 1; + break; + case OPT_GS1: + my_symbol->input_mode = (my_symbol->input_mode & ~0x07) | GS1_MODE; + break; + case OPT_GSSEP: + my_symbol->output_options |= GS1_GS_SEPARATOR; + break; + case OPT_HEIGHT: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 109: Invalid symbol height value\n"); + return do_exit(1); + } + if ((val >= 1) && (val <= 1000)) { + my_symbol->height = val; + } else { + fprintf(stderr, "Warning 110: Symbol height out of range\n"); + fflush(stderr); + } + break; + case OPT_INIT: + my_symbol->output_options |= READER_INIT; + break; + case OPT_MIRROR: + /* Use filenames which reflect content */ + mirror_mode = 1; + break; + case OPT_MASK: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 148: Invalid mask value\n"); + return do_exit(1); + } + if (val > 7) { /* `val` >= 0 always */ + /* mask pattern >= 0 and <= 7 (i.e. values >= 1 and <= 8) only permitted */ + fprintf(stderr, "Warning 147: Invalid mask value\n"); + fflush(stderr); + } else { + mask = val + 1; + } + break; + case OPT_MODE: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 136: Invalid mode value\n"); + return do_exit(1); + } + if (val <= 6) { /* `val` >= 0 always */ + my_symbol->option_1 = val; + } else { + fprintf(stderr, "Warning 116: Invalid mode\n"); + fflush(stderr); + } + break; + case OPT_NOBACKGROUND: + strcpy(my_symbol->bgcolour, "ffffff00"); + break; + case OPT_NOTEXT: + my_symbol->show_hrt = 0; + break; + case OPT_PRIMARY: + if (strlen(optarg) <= 127) { + strcpy(my_symbol->primary, optarg); + } else { + fprintf(stderr, "Warning 115: Primary data string too long, ignoring\n"); + fflush(stderr); + } + break; + case OPT_ROTATE: + /* Only certain inputs allowed */ + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 117: Invalid rotation value\n"); + return do_exit(1); + } + switch (val) { + case 90: rotate_angle = 90; + break; + case 180: rotate_angle = 180; + break; + case 270: rotate_angle = 270; + break; + case 0: rotate_angle = 0; + break; + default: + fprintf(stderr, "Warning 137: Invalid rotation parameter\n"); fflush(stderr); - } else { - strncpy(filetype, optarg, (size_t) 3); - } + break; } - if (!strcmp(long_options[option_index].name, "eci")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 138: Invalid ECI value\n"); - exit(1); - } - if ((atoi(optarg) >= 0) && (atoi(optarg) <= 999999)) { - my_symbol->eci = atoi(optarg); - } else { - fprintf(stderr, "Warning 118: Invalid ECI code\n"); - fflush(stderr); - } + break; + case OPT_ROWS: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 132: Invalid rows value\n"); + return do_exit(1); } - if (!strcmp(long_options[option_index].name, "esc")) { - my_symbol->input_mode |= ESCAPE_MODE; + if ((val >= 1) && (val <= 44)) { + my_symbol->option_1 = val; + } else { + fprintf(stderr, "Warning 112: Number of rows out of range\n"); + fflush(stderr); } - if (!strcmp(long_options[option_index].name, "verbose")) { - my_symbol->debug = 1; + break; + case OPT_SCALE: + my_symbol->scale = (float) (atof(optarg)); + if (my_symbol->scale < 0.01f) { + /* Zero and negative values are not permitted */ + fprintf(stderr, "Warning 105: Invalid scale value\n"); + fflush(stderr); + my_symbol->scale = 1.0f; } - if (!strcmp(long_options[option_index].name, "fontsize")) { - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { - fprintf(stderr, "Error 130: Invalid font size value\n"); - exit(1); - } - if ((atoi(optarg) >= 0) && (atoi(optarg) <= 100)) { - my_symbol->fontsize = atoi(optarg); - } else { - fprintf(stderr, "Warning 126: Invalid font size\n"); - fflush(stderr); - } + break; + case OPT_SCMVV: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 149: Invalid Structured Carrier Message version value\n"); + return do_exit(1); } - if (!strcmp(long_options[option_index].name, "nobackground")) { - strcpy(my_symbol->bgcolour, "ffffff00"); + if (val <= 99) { /* `val` >= 0 always */ + my_symbol->option_2 = val + 1; + } else { + /* Version 00-99 only */ + fprintf(stderr, "Warning 150: Invalid version (vv) for Structured Carrier Message, ignoring\n"); + fflush(stderr); } - if (!strcmp(long_options[option_index].name, "werror")) { - my_symbol->warn_level = WARN_FAIL_ALL; + break; + case OPT_SECURE: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 134: Invalid ECC value\n"); + return do_exit(1); } - if (!strcmp(long_options[option_index].name, "wzpl")) { - my_symbol->warn_level = WARN_ZPL_COMPAT; + if (val <= 8) { /* `val` >= 0 always */ + my_symbol->option_1 = val; + } else { + fprintf(stderr, "Warning 114: ECC level out of range\n"); + fflush(stderr); } break; + case OPT_SEPARATOR: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 128: Invalid separator value\n"); + return do_exit(1); + } + if (val <= 4) { /* `val` >= 0 always */ + separator = val; + } else { + /* Greater than 4 values are not permitted */ + fprintf(stderr, "Warning 127: Invalid separator value\n"); + fflush(stderr); + } + break; + case OPT_SMALL: + my_symbol->output_options |= SMALL_TEXT; + break; + case OPT_SQUARE: + my_symbol->option_3 = DM_SQUARE; + break; + case OPT_VERBOSE: + my_symbol->debug = 1; + break; + case OPT_VERS: + if (!validate_int(optarg, &val)) { + fprintf(stderr, "Error 133: Invalid version value\n"); + return do_exit(1); + } + if ((val >= 1) && (val <= 84)) { + my_symbol->option_2 = val; + } else { + fprintf(stderr, "Warning 113: Invalid version\n"); + fflush(stderr); + } + break; + case OPT_WERROR: + my_symbol->warn_level = WARN_FAIL_ALL; + break; + case OPT_WZPL: + my_symbol->warn_level = WARN_ZPL_COMPAT; + break; case 'h': usage(); @@ -906,22 +1170,20 @@ int main(int argc, char **argv) { break; case 'b': - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { + if (!validate_int(optarg, &val) && !(val = get_barcode_name(optarg))) { fprintf(stderr, "Error 119: Invalid barcode type '%s'\n", optarg); - exit(1); + return do_exit(1); } - my_symbol->symbology = atoi(optarg); + my_symbol->symbology = val; break; case 'w': - error_number = validator(NESET, optarg); - if (error_number == ZINT_ERROR_INVALID_DATA) { + if (!validate_int(optarg, &val)) { fprintf(stderr, "Error 120: Invalid whitespace value '%s'\n", optarg); - exit(1); + return do_exit(1); } - if ((atoi(optarg) >= 0) && (atoi(optarg) <= 1000)) { - my_symbol->whitespace_width = atoi(optarg); + if (val <= 1000) { /* `val` >= 0 always */ + my_symbol->whitespace_width = val; } else { fprintf(stderr, "Warning 121: Whitespace value out of range\n"); fflush(stderr); @@ -947,7 +1209,8 @@ int main(int argc, char **argv) { data_arg_num++; input_cnt++; } else { - fprintf(stderr, "Warning 143: Can only define one input file in batch mode, ignoring '%s'\n", optarg); + fprintf(stderr, "Warning 143: Can only define one input file in batch mode, ignoring '%s'\n", + optarg); fflush(stderr); } break; @@ -1003,10 +1266,13 @@ int main(int argc, char **argv) { } if (filetype[0] == '\0') { outfile_extension = get_extension(my_symbol->outfile); - // TODO: Determine if PNG available - strcpy(filetype, outfile_extension && supported_filetype(outfile_extension) ? outfile_extension : "png"); + if (outfile_extension && supported_filetype(outfile_extension, no_png, NULL)) { + strcpy(filetype, outfile_extension); + } else { + strcpy(filetype, no_png ? "gif" : "png"); + } } - if (my_symbol->scale < 0.5f && is_raster(filetype)) { + if (my_symbol->scale < 0.5f && is_raster(filetype, no_png)) { fprintf(stderr, "Warning 145: Scaling less than 0.5 will be set to 0.5 for '%s' output\n", filetype); fflush(stderr); } @@ -1016,16 +1282,18 @@ int main(int argc, char **argv) { fflush(stderr); } } else { - if (*filetype != '\0') { + if (filetype[0] != '\0') { set_extension(my_symbol->outfile, filetype); } - if (my_symbol->scale < 0.5f && is_raster(get_extension(my_symbol->outfile))) { - fprintf(stderr, "Warning 146: Scaling less than 0.5 will be set to 0.5 for '%s' output\n", get_extension(my_symbol->outfile)); + if (my_symbol->scale < 0.5f && is_raster(get_extension(my_symbol->outfile), no_png)) { + fprintf(stderr, "Warning 146: Scaling less than 0.5 will be set to 0.5 for '%s' output\n", + get_extension(my_symbol->outfile)); fflush(stderr); } for (i = 0; i < data_arg_num; i++) { if (arg_opts[i].opt == 'd') { - ret = ZBarcode_Encode(my_symbol, (unsigned char *) arg_opts[i].arg, strlen(arg_opts[i].arg)); + ret = ZBarcode_Encode(my_symbol, (unsigned char *) arg_opts[i].arg, + (int) strlen(arg_opts[i].arg)); } else { ret = ZBarcode_Encode_File(my_symbol, arg_opts[i].arg); } @@ -1053,5 +1321,5 @@ int main(int argc, char **argv) { ZBarcode_Delete(my_symbol); - return error_number; + return do_exit(error_number); } diff --git a/frontend/tests/test_args.c b/frontend/tests/test_args.c index b1c19569..ac65ed0f 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 Robin Stuart + Copyright (C) 2020 - 2021 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -329,6 +329,7 @@ static void test_input(int index, int debug) { for (int i = 0; i < data_size; i++) { if (index != -1 && i != index) continue; + if ((debug & ZINT_DEBUG_TEST_PRINT) && !(debug & ZINT_DEBUG_TEST_LESS_NOISY)) printf("i:%d\n", i); strcpy(cmd, "zint"); if (debug & ZINT_DEBUG_PRINT) { @@ -490,6 +491,7 @@ static void test_batch_large(int index, int debug) { for (int i = 0; i < data_size; i++) { if (index != -1 && i != index) continue; + if ((debug & ZINT_DEBUG_TEST_PRINT) && !(debug & ZINT_DEBUG_TEST_LESS_NOISY)) printf("i:%d\n", i); strcpy(cmd, "zint --batch"); if (debug & ZINT_DEBUG_PRINT) { @@ -535,6 +537,7 @@ static void test_checks(int index, int debug) { int rotate; int rows; double scale; + int scmvv; int secure; int separator; int vers; @@ -544,35 +547,38 @@ static void test_checks(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { -2, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 139: Invalid add-on gap value" }, - /* 1*/ { 6, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 140: Invalid add-on gap value" }, - /* 2*/ { -1, -2, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 107: Invalid border width value" }, - /* 3*/ { -1, 1001, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 108: Border width out of range" }, - /* 4*/ { -1, -1, -1, 0.009, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 106: Invalid dot radius value" }, - /* 5*/ { -1, -1, -2, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 131: Invalid columns value" }, - /* 6*/ { -1, -1, 68, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 111: Number of columns out of range" }, - /* 7*/ { -1, -1, -1, -1, -2, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 138: Invalid ECI value" }, - /* 8*/ { -1, -1, -1, -1, 1000000, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 118: Invalid ECI code" }, - /* 9*/ { -1, -1, -1, -1, -1, "jpg", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 142: File type 'jpg' not supported, ignoring" }, - /* 10*/ { -1, -1, -1, -1, -1, NULL, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 109: Invalid symbol height value" }, - /* 11*/ { -1, -1, -1, -1, -1, NULL, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height out of range" }, - /* 12*/ { -1, -1, -1, -1, -1, NULL, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, "Error 148: Invalid mask value" }, - /* 13*/ { -1, -1, -1, -1, -1, NULL, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 147: Invalid mask value" }, - /* 14*/ { -1, -1, -1, -1, -1, NULL, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, "Warning 116: Invalid mode" }, - /* 15*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, "Error 117: Invalid rotation value" }, - /* 16*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, "Warning 137: Invalid rotation parameter" }, - /* 17*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, "Error 132: Invalid rows value" }, - /* 18*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, "Warning 112: Number of rows out of range" }, - /* 19*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, "Warning 105: Invalid scale value" }, - /* 20*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, 0.49, -1, -1, -1, -1, "Warning 146: Scaling less than 0.5 will be set to 0.5 for 'png' output" }, - /* 21*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, "Error 134: Invalid ECC value" }, - /* 22*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, "Warning 114: ECC level out of range" }, - /* 23*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, "Error 128: Invalid separator value" }, - /* 24*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, "Warning 127: Invalid separator value" }, - /* 25*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, "Error 133: Invalid version value" }, - /* 26*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, 85, -1, "Warning 113: Invalid version" }, - /* 27*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, "Error 120: Invalid whitespace value '-2'" }, - /* 28*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, "Warning 121: Whitespace value out of range" }, + /* 0*/ { -2, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 139: Invalid add-on gap value" }, + /* 1*/ { 6, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 140: Invalid add-on gap value" }, + /* 2*/ { 13, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 140: Invalid add-on gap value" }, + /* 3*/ { -1, -2, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 107: Invalid border width value" }, + /* 4*/ { -1, 1001, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 108: Border width out of range" }, + /* 5*/ { -1, -1, -1, 0.009, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 106: Invalid dot radius value" }, + /* 6*/ { -1, -1, -2, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 131: Invalid columns value" }, + /* 7*/ { -1, -1, 68, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 111: Number of columns out of range" }, + /* 8*/ { -1, -1, -1, -1, -2, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 138: Invalid ECI value" }, + /* 9*/ { -1, -1, -1, -1, 1000000, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 118: Invalid ECI code" }, + /* 10*/ { -1, -1, -1, -1, -1, "jpg", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 142: File type 'jpg' not supported, ignoring" }, + /* 11*/ { -1, -1, -1, -1, -1, NULL, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 109: Invalid symbol height value" }, + /* 12*/ { -1, -1, -1, -1, -1, NULL, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height out of range" }, + /* 13*/ { -1, -1, -1, -1, -1, NULL, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 148: Invalid mask value" }, + /* 14*/ { -1, -1, -1, -1, -1, NULL, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 147: Invalid mask value" }, + /* 15*/ { -1, -1, -1, -1, -1, NULL, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 116: Invalid mode" }, + /* 16*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, "Error 117: Invalid rotation value" }, + /* 17*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, -1, "Warning 137: Invalid rotation parameter" }, + /* 18*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, "Error 132: Invalid rows value" }, + /* 19*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, "Warning 112: Number of rows out of range" }, + /* 20*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, "Warning 105: Invalid scale value" }, + /* 21*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, 0.49, -1, -1, -1, -1, -1, "Warning 146: Scaling less than 0.5 will be set to 0.5 for 'png' output" }, + /* 22*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, "Error 149: Invalid Structured Carrier Message version value" }, + /* 22*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, 100, -1, -1, -1, -1, "Warning 150: Invalid version (vv) for Structured Carrier Message, ignoring" }, + /* 22*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, "Error 134: Invalid ECC value" }, + /* 23*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, "Warning 114: ECC level out of range" }, + /* 24*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, "Error 128: Invalid separator value" }, + /* 25*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, "Warning 127: Invalid separator value" }, + /* 26*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, "Error 133: Invalid version value" }, + /* 27*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, 85, -1, "Warning 113: Invalid version" }, + /* 28*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, "Error 120: Invalid whitespace value '-2'" }, + /* 29*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, "Warning 121: Whitespace value out of range" }, }; int data_size = ARRAY_SIZE(data); @@ -601,6 +607,7 @@ static void test_checks(int index, int debug) { arg_int(cmd, "--rotate=", data[i].rotate); arg_int(cmd, "--rows=", data[i].rows); arg_double(cmd, "--scale=", data[i].scale); + arg_int(cmd, "--scmvv=", data[i].scmvv); arg_int(cmd, "--secure=", data[i].secure); arg_int(cmd, "--separator=", data[i].separator); arg_int(cmd, "--vers=", data[i].vers); @@ -619,6 +626,231 @@ static void test_checks(int index, int debug) { testFinish(); } +static void test_barcode_symbology(int index, int debug) { + + testStart(""); + + struct item { + const char *bname; + const char *data; + const char *primary; + int fail; + const char *expected; + }; + // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + static const struct item data[] = { + /* 0*/ { "_", "1", NULL, 1, "Error 119: Invalid barcode type '_'" }, + /* 1*/ { "a", "1", NULL, 1, "Error 119: Invalid barcode type 'a'" }, + /* 2*/ { "code128", "1", NULL, 0, "symbology: 20," }, + /* 3*/ { "code218", "1", NULL, 1, "Error 119: Invalid barcode type 'code218'" }, + /* 4*/ { "code12", "1", NULL, 1, "Error 119: Invalid barcode type 'code12'" }, + /* 5*/ { "BARCODE_CODE11", "1", NULL, 0, "symbology: 1," }, + /* 6*/ { "C25 Standard", "1", NULL, 0, "symbology: 2," }, + /* 7*/ { "c25matrix", "1", NULL, 1, "Error 119: Invalid barcode type 'c25matrix'" }, // Legacy not supported + /* 8*/ { "C25INTER", "1", NULL, 0, "symbology: 3," }, + /* 9*/ { "c25IATA", "1", NULL, 0, "symbology: 4," }, + /* 10*/ { "c25 Logic", "1", NULL, 0, "symbology: 6," }, + /* 11*/ { "c25 Ind", "1", NULL, 0, "symbology: 7," }, + /* 12*/ { "code39", "1", NULL, 0, "symbology: 8," }, + /* 13*/ { "excode 39", "1", NULL, 0, "symbology: 9," }, + /* 14*/ { "eanx", "1", NULL, 0, "symbology: 13," }, + /* 15*/ { "eanx chk", "1", NULL, 0, "symbology: 14," }, + /* 16*/ { "eanxchk", "1", NULL, 0, "symbology: 14," }, + /* 17*/ { "GS1128", "[01]12345678901231", NULL, 0, "symbology: 16," }, + /* 18*/ { "coda bar", "A1B", NULL, 0, "symbology: 18," }, + /* 19*/ { "DPLEIT", "1", NULL, 0, "symbology: 21," }, + /* 20*/ { "DPIDENT", "1", NULL, 0, "symbology: 22," }, + /* 21*/ { "code16k", "1", NULL, 0, "symbology: 23," }, + /* 22*/ { "CODE49", "1", NULL, 0, "symbology: 24," }, + /* 23*/ { "CODE93", "1", NULL, 0, "symbology: 25," }, + /* 24*/ { "flat", "1", NULL, 0, "symbology: 28," }, + /* 25*/ { "dbar omn", "1", NULL, 0, "symbology: 29," }, + /* 26*/ { "dbar ltd", "1", NULL, 0, "symbology: 30," }, + /* 27*/ { "dbarexp", "[10]12", NULL, 0, "symbology: 31," }, + /* 28*/ { "telepen", "1", NULL, 0, "symbology: 32," }, + /* 29*/ { "upc", "1", NULL, 1, "Error 119: Invalid barcode type 'upc'" }, + /* 30*/ { "upca", "1", NULL, 0, "symbology: 34," }, + /* 31*/ { "upca_chk", "123456789012", NULL, 0, "symbology: 35," }, + /* 33*/ { "upce", "1", NULL, 0, "symbology: 37," }, + /* 34*/ { "upce chk", "12345670", NULL, 0, "symbology: 38," }, + /* 36*/ { "POSTNET ", "12345678901", NULL, 0, "symbology: 40," }, + /* 37*/ { "MSI Plessey ", "1", NULL, 0, "symbology: 47," }, + /* 38*/ { "fim ", "A", NULL, 0, "symbology: 49," }, + /* 39*/ { "LOGMARS", "123456", NULL, 0, "symbology: 50," }, + /* 40*/ { " pharma", "123456", NULL, 0, "symbology: 51," }, + /* 41*/ { " pzn ", "1", NULL, 0, "symbology: 52," }, + /* 42*/ { "pharma two", "4", NULL, 0, "symbology: 53," }, + /* 43*/ { "BARCODE_PDF417", "1", NULL, 0, "symbology: 55," }, + /* 44*/ { "barcodepdf417comp", "1", NULL, 0, "symbology: 56," }, + /* 45*/ { "MaxiCode", "1", NULL, 0, "symbology: 57," }, + /* 46*/ { "QR CODE", "1", NULL, 0, "symbology: 58," }, + /* 47*/ { "qr", "1", NULL, 0, "symbology: 58," }, // Synonym + /* 48*/ { "Code 128 B", "1", NULL, 0, "symbology: 60," }, + /* 49*/ { "AUS POST", "12345678901234567890123", NULL, 0, "symbology: 63," }, + /* 50*/ { "AusReply", "12345678", NULL, 0, "symbology: 66," }, + /* 51*/ { "AUSROUTE", "12345678", NULL, 0, "symbology: 67," }, + /* 52*/ { "AUS REDIRECT", "12345678", NULL, 0, "symbology: 68," }, + /* 53*/ { "isbnx", "123456789", NULL, 0, "symbology: 69," }, + /* 54*/ { "rm4scc", "1", NULL, 0, "symbology: 70," }, + /* 55*/ { "DataMatrix", "1", NULL, 0, "symbology: 71," }, + /* 56*/ { "EAN14", "1", NULL, 0, "symbology: 72," }, + /* 57*/ { "vin", "12345678701234567", NULL, 0, "symbology: 73," }, + /* 58*/ { "CodaBlock-F", "1", NULL, 0, "symbology: 74," }, + /* 59*/ { "NVE18", "1", NULL, 0, "symbology: 75," }, + /* 60*/ { "Japan Post", "1", NULL, 0, "symbology: 76," }, + /* 61*/ { "Korea Post", "1", NULL, 0, "symbology: 77," }, + /* 62*/ { "DBar Stk", "1", NULL, 0, "symbology: 79," }, + /* 63*/ { "DBar Omn Stk", "1", NULL, 0, "symbology: 80," }, + /* 64*/ { "DBar Exp Stk", "[20]01", NULL, 0, "symbology: 81," }, + /* 65*/ { "planet", "12345678901", NULL, 0, "symbology: 82," }, + /* 66*/ { "MicroPDF417", "1", NULL, 0, "symbology: 84," }, + /* 67*/ { "USPS IMail", "12345678901234567890", NULL, 0, "symbology: 85," }, + /* 68*/ { "plessey", "1", NULL, 0, "symbology: 86," }, + /* 69*/ { "telepen num", "1", NULL, 0, "symbology: 87," }, + /* 70*/ { "ITF14", "1", NULL, 0, "symbology: 89," }, + /* 71*/ { "KIX", "1", NULL, 0, "symbology: 90," }, + /* 72*/ { "Aztec", "1", NULL, 0, "symbology: 92," }, + /* 73*/ { "daft", "D", NULL, 0, "symbology: 93," }, + /* 74*/ { "DPD", "0123456789012345678901234567", NULL, 0, "symbology: 96," }, + /* 75*/ { "Micro QR", "1", NULL, 0, "symbology: 97," }, + /* 76*/ { "hibc128", "1", NULL, 0, "symbology: 98," }, + /* 76*/ { "hibccode128", "1", NULL, 0, "symbology: 98," }, // Synonym + /* 77*/ { "hibc39", "1", NULL, 0, "symbology: 99," }, + /* 77*/ { "hibccode39", "1", NULL, 0, "symbology: 99," }, // Synonym + /* 78*/ { "hibcdatamatrix", "1", NULL, 0, "symbology: 102," }, // Synonym + /* 78*/ { "hibcdm", "1", NULL, 0, "symbology: 102," }, + /* 79*/ { "HIBC qr", "1", NULL, 0, "symbology: 104," }, + /* 79*/ { "HIBC QR Code", "1", NULL, 0, "symbology: 104," }, // Synonym + /* 80*/ { "HIBCPDF", "1", NULL, 0, "symbology: 106," }, + /* 80*/ { "HIBCPDF417", "1", NULL, 0, "symbology: 106," }, // Synonym + /* 81*/ { "HIBCMICPDF", "1", NULL, 0, "symbology: 108," }, + /* 81*/ { "HIBC Micro PDF", "1", NULL, 0, "symbology: 108," }, // Synonym + /* 81*/ { "HIBC Micro PDF417", "1", NULL, 0, "symbology: 108," }, // Synonym + /* 81*/ { "HIBC BlockF", "1", NULL, 0, "symbology: 110," }, + /* 81*/ { "HIBC CodaBlock-F", "1", NULL, 0, "symbology: 110," }, // Synonym + /* 82*/ { "HIBC Aztec", "1", NULL, 0, "symbology: 112," }, + /* 83*/ { "DotCode", "1", NULL, 0, "symbology: 115," }, + /* 84*/ { "Han Xin", "1", NULL, 0, "symbology: 116," }, + /* 85*/ { "Mailmark", "01000000000000000AA00AA0A", NULL, 0, "symbology: 121," }, + /* 86*/ { "azrune", "1", NULL, 0, "symbology: 128," }, + /* 86*/ { "aztecrune", "1", NULL, 0, "symbology: 128," }, // Synonym + /* 86*/ { "aztecrunes", "1", NULL, 0, "symbology: 128," }, // Synonym + /* 87*/ { "code32", "1", NULL, 0, "symbology: 129," }, + /* 88*/ { "eanx cc", "[20]01", "1234567890128", 0, "symbology: 130," }, + /* 89*/ { "GS1 128 CC", "[01]12345678901231", "[20]01", 0, "symbology: 131," }, + /* 90*/ { "dbaromncc", "[20]01", "1234567890123", 0, "symbology: 132," }, + /* 91*/ { "dbarltdcc", "[20]01", "1234567890123", 0, "symbology: 133," }, + /* 92*/ { "dbarexpcc", "[20]01", "[01]12345678901231", 0, "symbology: 134," }, + /* 93*/ { "upcacc", "[20]01", "12345678901", 0, "symbology: 135," }, + /* 94*/ { "upcecc", "[20]01", "1234567", 0, "symbology: 136," }, + /* 95*/ { "dbar stk cc", "[20]01", "1234567890123", 0, "symbology: 137," }, + /* 96*/ { "dbaromnstkcc", "[20]01", "1234567890123", 0, "symbology: 138," }, + /* 97*/ { "dbarexpstkcc", "[20]01", "[01]12345678901231", 0, "symbology: 139," }, + /* 98*/ { "Channel", "1", NULL, 0, "symbology: 140," }, + /* 99*/ { "CodeOne", "1", NULL, 0, "symbology: 141," }, + /*100*/ { "Grid Matrix", "1", NULL, 0, "symbology: 142," }, + /*101*/ { "UPN QR", "1", NULL, 0, "symbology: 143," }, + /*102*/ { "UPN QR Code", "1", NULL, 0, "symbology: 143," }, // Synonym + /*103*/ { "ultra", "1", NULL, 0, "symbology: 144," }, + /*104*/ { "ultracode", "1", NULL, 0, "symbology: 144," }, // Synonym + /*105*/ { "rMQR", "1", NULL, 0, "symbology: 145," }, + /*106*/ { "x", "1", NULL, 1, "Error 119: Invalid barcode type 'x'" }, + /*107*/ { "\177", "1", NULL, 1, "Error 119: Invalid barcode type '\177'" }, + }; + int data_size = ARRAY_SIZE(data); + + char cmd[4096]; + char buf[8192]; + char *outfilename = "out.png"; + + for (int i = 0; i < data_size; i++) { + + if (index != -1 && i != index) continue; + + strcpy(cmd, "zint "); + strcat(cmd, " --verbose"); + + arg_data(cmd, "-b ", data[i].bname); + arg_data(cmd, "-d ", data[i].data); + arg_data(cmd, "--primary=", data[i].primary); + + strcat(cmd, " 2>&1"); + + assert_nonnull(exec(cmd, buf, sizeof(buf) - 1, debug, i), "i:%d exec(%s) NULL\n", i, cmd); + assert_nonnull(strstr(buf, data[i].expected), "i:%d strstr(%s, %s) == NULL\n", i, buf, data[i].expected); + if (!data[i].fail) { + assert_zero(remove(outfilename), "i:%d remove(%s) != 0 (%d)\n", i, outfilename, errno); + } + } + + testFinish(); +} + +static void test_other_opts(int index, int debug) { + + testStart(""); + + struct item { + int b; + char *data; + int input_mode; + char *opt; + char *opt_data; + + char *expected; + }; + // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + struct item data[] = { + /* 0*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900", "" }, + /* 1*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900AA", "" }, + /* 2*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 654: Malformed background colour target" }, + /* 3*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000", "" }, + /* 4*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "" }, + /* 5*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 651: Malformed foreground colour target" }, + /* 6*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 653: Malformed foreground colour target" }, + /* 7*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "10", "" }, + /* 8*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "101", "Warning 126: Invalid font size" }, + /* 9*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "" }, + /* 10*/ { BARCODE_CODE128, "1", -1, " --notext", "", "" }, + /* 11*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "" }, + /* 12*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "" }, + /* 13*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported" }, + /* 14*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "" }, + /* 15*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI" }, + /* 16*/ { BARCODE_GS1_128, "0112345678901231", -1, " --wzpl", NULL, "Warning 252: Data does not start with an AI" }, + /* 17*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "" }, + /* 18*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'" }, + /* 19*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --wzpl", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'" }, + /* 20*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'" }, + }; + int data_size = ARRAY_SIZE(data); + char cmd[4096]; + char buf[8192]; + + for (int i = 0; i < data_size; i++) { + + if (index != -1 && i != index) continue; + + strcpy(cmd, "zint"); + + arg_int(cmd, "-b ", data[i].b); + arg_input_mode(cmd, data[i].input_mode); + arg_data(cmd, "-d ", data[i].data); + if (data[i].opt_data != NULL) { + arg_data(cmd, data[i].opt, data[i].opt_data); + } else { + strcat(cmd, data[i].opt); + } + + strcat(cmd, " 2>&1"); + + assert_nonnull(exec(cmd, buf, sizeof(buf) - 1, debug, i), "i:%d exec(%s) NULL\n", i, cmd); + assert_zero(strcmp(buf, data[i].expected), "i:%d buf (%s) != expected (%s) (%s)\n", i, buf, data[i].expected, cmd); + } + + testFinish(); +} + int main(int argc, char *argv[]) { testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */ @@ -628,6 +860,8 @@ int main(int argc, char *argv[]) { { "test_batch_input", test_batch_input, 1, 0, 1 }, { "test_batch_large", test_batch_large, 1, 0, 1 }, { "test_checks", test_checks, 1, 0, 1 }, + { "test_barcode_symbology", test_barcode_symbology, 1, 0, 1 }, + { "test_other_opts", test_other_opts, 1, 0, 1 }, }; testRun(argc, argv, funcs, ARRAY_SIZE(funcs));