diff --git a/ChangeLog b/ChangeLog index bdd2b4fe..0b819b75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ Changes in filenames - Add symbology BC412 (beta) - backend: use alloca() (z_alloca()) for both Unix and Windows +- GS1: new AI 4309 with latlong checker, new currency code 925 Bugs ---- diff --git a/backend/gs1.c b/backend/gs1.c index 06fab95f..ac12c181 100644 --- a/backend/gs1.c +++ b/backend/gs1.c @@ -1172,6 +1172,42 @@ static int couponposoffer(const unsigned char *data, int data_len, int offset, i return 1; } +/* Check WSG 84 latitude, longitude */ +static int latlong(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no, + int *p_err_posn, char err_msg[50], const int length_only) { + (void)max; + + data_len -= offset; + + if (data_len < min || (data_len && data_len < 20)) { + return 0; + } + + if (!length_only && data_len) { + const unsigned char *d = data + offset; + const unsigned char *const de = d + (data_len > max ? max : data_len); + uint64_t lat = 0, lng = 0; + + for (; d < de; d++) { + if (de - d > 10) { + lat *= 10; + lat += *d - '0'; + } else { + lng *= 10; + lng += *d - '0'; + } + } + if (lat > 1800000000 || lng > 3600000000) { + *p_err_no = 3; + *p_err_posn = d - 1 - data + 1 - 10 * (lat > 1800000000); + sprintf(err_msg, "Invalid %s", lat > 1800000000 ? "latitude" : "longitude"); + return 0; + } + } + + return 1; +} + /* Generated by "php backend/tools/gen_gs1_linter.php > backend/gs1_lint.h" */ #include "gs1_lint.h" diff --git a/backend/gs1_lint.h b/backend/gs1_lint.h index fe0a4a41..6fa17266 100644 --- a/backend/gs1_lint.h +++ b/backend/gs1_lint.h @@ -1,10 +1,10 @@ /* * GS1 AI checker generated by "backend/tools/gen_gs1_lint.php" from - * https://raw.githubusercontent.com/bwipp/postscriptbarcode/master/contrib/development/gs1-format-spec.txt + * standards/GS1/gs1-syntax-dictionary-2022-07-11.txt */ /* libzint - the open source barcode library - Copyright (C) 2021 Robin Stuart + Copyright (C) 2021-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -31,9 +31,10 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* SPDX-License-Identifier: BSD-3-Clause */ -#ifndef GS1_LINT_H -#define GS1_LINT_H +#ifndef Z_GS1_LINT_H +#define Z_GS1_LINT_H /* N18,csum,key (Used by SSCC) */ static int n18_csum_key(const unsigned char *data, const int data_len, @@ -57,8 +58,8 @@ static int n14_csum_key(const unsigned char *data, const int data_len, && key(data, data_len, 0, 14, 14, p_err_no, p_err_posn, err_msg, 0); } -/* X1..20 (Used by BATCH/LOT, SERIAL, CPV, PCN...) */ -static int x1__20(const unsigned char *data, const int data_len, +/* X..20 (Used by BATCH/LOT, SERIAL, CPV, PCN...) */ +static int x__20(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 20 && cset82(data, data_len, 0, 1, 20, p_err_no, p_err_posn, err_msg); @@ -80,29 +81,29 @@ static int n2(const unsigned char *data, const int data_len, && numeric(data, data_len, 0, 2, 2, p_err_no, p_err_posn, err_msg); } -/* X1..28 (Used by TPX) */ -static int x1__28(const unsigned char *data, const int data_len, +/* X..28 (Used by TPX) */ +static int x__28(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 28 && cset82(data, data_len, 0, 1, 28, p_err_no, p_err_posn, err_msg); } -/* X1..30 (Used by ADDITIONAL ID, CUST. PART NO., SECONDARY SERIAL, REF. TO SOURCE...) */ -static int x1__30(const unsigned char *data, const int data_len, +/* X..30 (Used by ADDITIONAL ID, CUST. PART NO., SECONDARY SERIAL, REF. TO SOURCE...) */ +static int x__30(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 30 && cset82(data, data_len, 0, 1, 30, p_err_no, p_err_posn, err_msg); } -/* N1..6 (Used by MTO VARIANT) */ -static int n1__6(const unsigned char *data, const int data_len, +/* N..6 (Used by MTO VARIANT) */ +static int n__6(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 6 && numeric(data, data_len, 0, 1, 6, p_err_no, p_err_posn, err_msg); } -/* N13,csum,key X0..17 (Used by GDTI) */ -static int n13_csum_key_x0__17(const unsigned char *data, const int data_len, +/* N13,csum,key [X..17] (Used by GDTI) */ +static int n13_csum_key__x__17_(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 13 && data_len <= 30 && csum(data, data_len, 0, 13, 13, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -113,8 +114,8 @@ static int n13_csum_key_x0__17(const unsigned char *data, const int data_len, && cset82(data, data_len, 13, 0, 17, p_err_no, p_err_posn, err_msg); } -/* N13,csum,key N0..12 (Used by GCN) */ -static int n13_csum_key_n0__12(const unsigned char *data, const int data_len, +/* N13,csum,key [N..12] (Used by GCN) */ +static int n13_csum_key__n__12_(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 13 && data_len <= 25 && csum(data, data_len, 0, 13, 13, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -125,8 +126,8 @@ static int n13_csum_key_n0__12(const unsigned char *data, const int data_len, && numeric(data, data_len, 13, 0, 12, p_err_no, p_err_posn, err_msg); } -/* N1..8 (Used by VAR. COUNT, COUNT) */ -static int n1__8(const unsigned char *data, const int data_len, +/* N..8 (Used by VAR. COUNT, COUNT) */ +static int n__8(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 8 && numeric(data, data_len, 0, 1, 8, p_err_no, p_err_posn, err_msg); @@ -139,15 +140,15 @@ static int n6(const unsigned char *data, const int data_len, && numeric(data, data_len, 0, 6, 6, p_err_no, p_err_posn, err_msg); } -/* N1..15 (Used by AMOUNT, PRICE) */ -static int n1__15(const unsigned char *data, const int data_len, +/* N..15 (Used by AMOUNT, PRICE) */ +static int n__15(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 15 && numeric(data, data_len, 0, 1, 15, p_err_no, p_err_posn, err_msg); } -/* N3,iso4217 N1..15 (Used by AMOUNT, PRICE) */ -static int n3_iso4217_n1__15(const unsigned char *data, const int data_len, +/* N3,iso4217 N..15 (Used by AMOUNT, PRICE) */ +static int n3_iso4217_n__15(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 4 && data_len <= 18 && iso4217(data, data_len, 0, 3, 3, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -163,8 +164,8 @@ static int n4(const unsigned char *data, const int data_len, && numeric(data, data_len, 0, 4, 4, p_err_no, p_err_posn, err_msg); } -/* X1..30,key (Used by GINC, GIAI - ASSEMBLY, GIAI) */ -static int x1__30_key(const unsigned char *data, const int data_len, +/* X..30,key (Used by GINC, GIAI - ASSEMBLY, GIAI) */ +static int x__30_key(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 30 && key(data, data_len, 0, 1, 30, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -194,8 +195,8 @@ static int n13_csum_key(const unsigned char *data, const int data_len, && key(data, data_len, 0, 13, 13, p_err_no, p_err_posn, err_msg, 0); } -/* N3,iso3166 X1..9 (Used by SHIP TO POST) */ -static int n3_iso3166_x1__9(const unsigned char *data, const int data_len, +/* N3,iso3166 X..9 (Used by SHIP TO POST) */ +static int n3_iso3166_x__9(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 4 && data_len <= 12 && iso3166(data, data_len, 0, 3, 3, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -213,24 +214,24 @@ static int n3_iso3166(const unsigned char *data, const int data_len, && iso3166(data, data_len, 0, 3, 3, p_err_no, p_err_posn, err_msg, 0); } -/* N3..15,iso3166list (Used by COUNTRY - INITIAL PROCESS, COUNTRY - DISASSEMBLY) */ -static int n3__15_iso3166list(const unsigned char *data, const int data_len, +/* N..15,iso3166list (Used by COUNTRY - INITIAL PROCESS, COUNTRY - DISASSEMBLY) */ +static int n__15_iso3166list(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { - return data_len >= 3 && data_len <= 15 - && iso3166list(data, data_len, 0, 3, 15, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) - && numeric(data, data_len, 0, 3, 15, p_err_no, p_err_posn, err_msg) - && iso3166list(data, data_len, 0, 3, 15, p_err_no, p_err_posn, err_msg, 0); + return data_len >= 1 && data_len <= 15 + && iso3166list(data, data_len, 0, 1, 15, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) + && numeric(data, data_len, 0, 1, 15, p_err_no, p_err_posn, err_msg) + && iso3166list(data, data_len, 0, 1, 15, p_err_no, p_err_posn, err_msg, 0); } -/* X1..3 (Used by ORIGIN SUBDIVISION, AQUATIC SPECIES) */ -static int x1__3(const unsigned char *data, const int data_len, +/* X..3 (Used by ORIGIN SUBDIVISION, AQUATIC SPECIES) */ +static int x__3(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 3 && cset82(data, data_len, 0, 1, 3, p_err_no, p_err_posn, err_msg); } -/* X1..35,pcenc (Used by SHIP TO COMP, SHIP TO NAME, RTN TO COMP, RTN TO NAME...) */ -static int x1__35_pcenc(const unsigned char *data, const int data_len, +/* X..35,pcenc (Used by SHIP TO COMP, SHIP TO NAME, RTN TO COMP, RTN TO NAME...) */ +static int x__35_pcenc(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 35 && pcenc(data, data_len, 0, 1, 35, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -238,8 +239,8 @@ static int x1__35_pcenc(const unsigned char *data, const int data_len, && pcenc(data, data_len, 0, 1, 35, p_err_no, p_err_posn, err_msg, 0); } -/* X1..70,pcenc (Used by SHIP TO ADD1, SHIP TO ADD2, SHIP TO SUB, SHIP TO LOC...) */ -static int x1__70_pcenc(const unsigned char *data, const int data_len, +/* X..70,pcenc (Used by SHIP TO ADD1, SHIP TO ADD2, SHIP TO SUB, SHIP TO LOC...) */ +static int x__70_pcenc(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 70 && pcenc(data, data_len, 0, 1, 70, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -256,7 +257,16 @@ static int x2_iso3166alpha2(const unsigned char *data, const int data_len, && iso3166alpha2(data, data_len, 0, 2, 2, p_err_no, p_err_posn, err_msg, 0); } -/* N1,yesno (Used by DANGEROUS GOODS, AUTH LEAVE, SIG REQUIRED) */ +/* N20,latlong (Used by SHIP TO GEO) */ +static int n20_latlong(const unsigned char *data, const int data_len, + int *p_err_no, int *p_err_posn, char err_msg[50]) { + return data_len == 20 + && latlong(data, data_len, 0, 20, 20, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) + && numeric(data, data_len, 0, 20, 20, p_err_no, p_err_posn, err_msg) + && latlong(data, data_len, 0, 20, 20, p_err_no, p_err_posn, err_msg, 0); +} + +/* N1,yesno (Used by DANGEROUS GOODS, AUTH TO LEAVE, SIG REQUIRED) */ static int n1_yesno(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len == 1 @@ -265,7 +275,7 @@ static int n1_yesno(const unsigned char *data, const int data_len, && yesno(data, data_len, 0, 1, 1, p_err_no, p_err_posn, err_msg, 0); } -/* N6,yymmd0 N4,hhmm (Used by NBEF DEL DT., NAFT DEL DT.) */ +/* N6,yymmd0 N4,hhmm (Used by NOT BEF DEL DT, NOT AFT DEL DT) */ static int n6_yymmd0_n4_hhmm(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len == 10 @@ -305,22 +315,22 @@ static int n6_yymmdd_n4_hhmm(const unsigned char *data, const int data_len, && hhmm(data, data_len, 6, 4, 4, p_err_no, p_err_posn, err_msg, 0); } -/* N1..4 (Used by ACTIVE POTENCY) */ -static int n1__4(const unsigned char *data, const int data_len, +/* N..4 (Used by ACTIVE POTENCY) */ +static int n__4(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 4 && numeric(data, data_len, 0, 1, 4, p_err_no, p_err_posn, err_msg); } -/* X1..12 (Used by CATCH AREA) */ -static int x1__12(const unsigned char *data, const int data_len, +/* X..12 (Used by CATCH AREA) */ +static int x__12(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 12 && cset82(data, data_len, 0, 1, 12, p_err_no, p_err_posn, err_msg); } -/* N6,yymmdd N0..6,yymmdd (Used by HARVEST DATE) */ -static int n6_yymmdd_n0__6_yymmdd(const unsigned char *data, const int data_len, +/* N6,yymmdd [N6],yymmdd (Used by HARVEST DATE) */ +static int n6_yymmdd__n6__yymmdd(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 6 && data_len <= 12 && yymmdd(data, data_len, 0, 6, 6, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -331,22 +341,22 @@ static int n6_yymmdd_n0__6_yymmdd(const unsigned char *data, const int data_len, && yymmdd(data, data_len, 6, 0, 6, p_err_no, p_err_posn, err_msg, 0); } -/* X1..10 (Used by FISHING GEAR TYPE) */ -static int x1__10(const unsigned char *data, const int data_len, +/* X..10 (Used by FISHING GEAR TYPE) */ +static int x__10(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 10 && cset82(data, data_len, 0, 1, 10, p_err_no, p_err_posn, err_msg); } -/* X1..2 (Used by PROD METHOD) */ -static int x1__2(const unsigned char *data, const int data_len, +/* X..2 (Used by PROD METHOD) */ +static int x__2(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 2 && cset82(data, data_len, 0, 1, 2, p_err_no, p_err_posn, err_msg); } -/* N3,iso3166999 X1..27 (Used by PROCESSOR # s) */ -static int n3_iso3166999_x1__27(const unsigned char *data, const int data_len, +/* N3,iso3166999 X..27 (Used by PROCESSOR # 0, PROCESSOR # 1, PROCESSOR # 2, PROCESSOR # 3...) */ +static int n3_iso3166999_x__27(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 4 && data_len <= 30 && iso3166999(data, data_len, 0, 3, 3, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -367,8 +377,8 @@ static int n1_x1_x1_x1_importeridx(const unsigned char *data, const int data_len && importeridx(data, data_len, 3, 1, 1, p_err_no, p_err_posn, err_msg, 0); } -/* X2 X1..28 (Used by CERT # s) */ -static int x2_x1__28(const unsigned char *data, const int data_len, +/* X2 X..28 (Used by CERT # 1, CERT # 2, CERT # 3, CERT # 4...) */ +static int x2_x__28(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 3 && data_len <= 30 && cset82(data, data_len, 0, 2, 2, p_err_no, p_err_posn, err_msg) @@ -394,8 +404,8 @@ static int n4_nonzero_n5_nonzero_n3_nonzero_n1_winding_n1(const unsigned char *d && numeric(data, data_len, 13, 1, 1, p_err_no, p_err_posn, err_msg); } -/* N1,zero N13,csum,key X0..16 (Used by GRAI) */ -static int n1_zero_n13_csum_key_x0__16(const unsigned char *data, const int data_len, +/* N1,zero N13,csum,key [X..16] (Used by GRAI) */ +static int n1_zero_n13_csum_key__x__16_(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 14 && data_len <= 30 && zero(data, data_len, 0, 1, 1, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -421,8 +431,8 @@ static int n14_csum_n4_pieceoftotal(const unsigned char *data, const int data_le && pieceoftotal(data, data_len, 14, 4, 4, p_err_no, p_err_posn, err_msg, 0); } -/* X1..34,iban (Used by IBAN) */ -static int x1__34_iban(const unsigned char *data, const int data_len, +/* X..34,iban (Used by IBAN) */ +static int x__34_iban(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 34 && iban(data, data_len, 0, 1, 34, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -430,8 +440,8 @@ static int x1__34_iban(const unsigned char *data, const int data_len, && iban(data, data_len, 0, 1, 34, p_err_no, p_err_posn, err_msg, 0); } -/* N8,yymmddhh N0..4,mmoptss (Used by PROD TIME) */ -static int n8_yymmddhh_n0__4_mmoptss(const unsigned char *data, const int data_len, +/* N8,yymmddhh [N..4],mmoptss (Used by PROD TIME) */ +static int n8_yymmddhh__n__4__mmoptss(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 8 && data_len <= 12 && yymmddhh(data, data_len, 0, 8, 8, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -442,15 +452,15 @@ static int n8_yymmddhh_n0__4_mmoptss(const unsigned char *data, const int data_l && mmoptss(data, data_len, 8, 0, 4, p_err_no, p_err_posn, err_msg, 0); } -/* X1..50 (Used by OPTSEN) */ -static int x1__50(const unsigned char *data, const int data_len, +/* X..50 (Used by OPTSEN) */ +static int x__50(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 50 && cset82(data, data_len, 0, 1, 50, p_err_no, p_err_posn, err_msg); } -/* C1..30,key (Used by CPID) */ -static int c1__30_key(const unsigned char *data, const int data_len, +/* Y..30,key (Used by CPID) */ +static int y__30_key(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 30 && key(data, data_len, 0, 1, 30, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -458,8 +468,8 @@ static int c1__30_key(const unsigned char *data, const int data_len, && key(data, data_len, 0, 1, 30, p_err_no, p_err_posn, err_msg, 0); } -/* N1..12,nozeroprefix (Used by CPID SERIAL) */ -static int n1__12_nozeroprefix(const unsigned char *data, const int data_len, +/* N..12,nozeroprefix (Used by CPID SERIAL) */ +static int n__12_nozeroprefix(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 12 && nozeroprefix(data, data_len, 0, 1, 12, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -467,8 +477,8 @@ static int n1__12_nozeroprefix(const unsigned char *data, const int data_len, && nozeroprefix(data, data_len, 0, 1, 12, p_err_no, p_err_posn, err_msg, 0); } -/* X1..25,csumalpha,key (Used by GMN) */ -static int x1__25_csumalpha_key(const unsigned char *data, const int data_len, +/* X..25,csumalpha,key (Used by GMN) */ +static int x__25_csumalpha_key(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 25 && csumalpha(data, data_len, 0, 1, 25, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -487,22 +497,22 @@ static int n18_csum(const unsigned char *data, const int data_len, && csum(data, data_len, 0, 18, 18, p_err_no, p_err_posn, err_msg, 0); } -/* N1..10 (Used by SRIN) */ -static int n1__10(const unsigned char *data, const int data_len, +/* N..10 (Used by SRIN) */ +static int n__10(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 10 && numeric(data, data_len, 0, 1, 10, p_err_no, p_err_posn, err_msg); } -/* X1..25 (Used by REF NO.) */ -static int x1__25(const unsigned char *data, const int data_len, +/* X..25 (Used by REF NO.) */ +static int x__25(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 25 && cset82(data, data_len, 0, 1, 25, p_err_no, p_err_posn, err_msg); } -/* X1..70,couponcode */ -static int x1__70_couponcode(const unsigned char *data, const int data_len, +/* X..70,couponcode */ +static int x__70_couponcode(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 70 && couponcode(data, data_len, 0, 1, 70, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -510,8 +520,8 @@ static int x1__70_couponcode(const unsigned char *data, const int data_len, && couponcode(data, data_len, 0, 1, 70, p_err_no, p_err_posn, err_msg, 0); } -/* X1..70,couponposoffer */ -static int x1__70_couponposoffer(const unsigned char *data, const int data_len, +/* X..70,couponposoffer */ +static int x__70_couponposoffer(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 70 && couponposoffer(data, data_len, 0, 1, 70, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) @@ -519,15 +529,15 @@ static int x1__70_couponposoffer(const unsigned char *data, const int data_len, && couponposoffer(data, data_len, 0, 1, 70, p_err_no, p_err_posn, err_msg, 0); } -/* X1..70 (Used by PRODUCT URL) */ -static int x1__70(const unsigned char *data, const int data_len, +/* X..70 (Used by PRODUCT URL) */ +static int x__70(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 70 && cset82(data, data_len, 0, 1, 70, p_err_no, p_err_posn, err_msg); } -/* X1..90 (Used by INTERNAL) */ -static int x1__90(const unsigned char *data, const int data_len, +/* X..90 (Used by INTERNAL) */ +static int x__90(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { return data_len >= 1 && data_len <= 90 && cset82(data, data_len, 0, 1, 90, p_err_no, p_err_posn, err_msg); @@ -549,7 +559,7 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, return n14_csum_key(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 10 || ai == 21 || ai == 22) { - return x1__20(data, data_len, p_err_no, p_err_posn, err_msg); + return x__20(data, data_len, p_err_no, p_err_posn, err_msg); } if ((ai >= 11 && ai <= 13) || (ai >= 15 && ai <= 17)) { return n6_yymmd0(data, data_len, p_err_no, p_err_posn, err_msg); @@ -558,43 +568,43 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, return n2(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 30 || ai == 37) { - return n1__8(data, data_len, p_err_no, p_err_posn, err_msg); + return n__8(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 90) { - return x1__30(data, data_len, p_err_no, p_err_posn, err_msg); + return x__30(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai >= 91) { - return x1__90(data, data_len, p_err_no, p_err_posn, err_msg); + return x__90(data, data_len, p_err_no, p_err_posn, err_msg); } } else if (ai < 300) { if (ai == 235) { - return x1__28(data, data_len, p_err_no, p_err_posn, err_msg); + return x__28(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 240 || ai == 241 || ai == 250 || ai == 251) { - return x1__30(data, data_len, p_err_no, p_err_posn, err_msg); + return x__30(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 242) { - return n1__6(data, data_len, p_err_no, p_err_posn, err_msg); + return n__6(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 243 || ai == 254) { - return x1__20(data, data_len, p_err_no, p_err_posn, err_msg); + return x__20(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 253) { - return n13_csum_key_x0__17(data, data_len, p_err_no, p_err_posn, err_msg); + return n13_csum_key__x__17_(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 255) { - return n13_csum_key_n0__12(data, data_len, p_err_no, p_err_posn, err_msg); + return n13_csum_key__n__12_(data, data_len, p_err_no, p_err_posn, err_msg); } } else if (ai < 500) { if (ai == 400 || ai == 403) { - return x1__30(data, data_len, p_err_no, p_err_posn, err_msg); + return x__30(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 401) { - return x1__30_key(data, data_len, p_err_no, p_err_posn, err_msg); + return x__30_key(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 402) { return n17_csum_key(data, data_len, p_err_no, p_err_posn, err_msg); @@ -603,25 +613,25 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, return n13_csum_key(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 420) { - return x1__20(data, data_len, p_err_no, p_err_posn, err_msg); + return x__20(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 421) { - return n3_iso3166_x1__9(data, data_len, p_err_no, p_err_posn, err_msg); + return n3_iso3166_x__9(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 422 || ai == 424 || ai == 426) { return n3_iso3166(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 423 || ai == 425) { - return n3__15_iso3166list(data, data_len, p_err_no, p_err_posn, err_msg); + return n__15_iso3166list(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 427) { - return x1__3(data, data_len, p_err_no, p_err_posn, err_msg); + return x__3(data, data_len, p_err_no, p_err_posn, err_msg); } } else if (ai < 800) { if (ai >= 710 && ai <= 715) { - return x1__20(data, data_len, p_err_no, p_err_posn, err_msg); + return x__20(data, data_len, p_err_no, p_err_posn, err_msg); } } else if (ai < 3200) { @@ -675,10 +685,10 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, } else if (ai < 4000) { if ((ai >= 3900 && ai <= 3909) || (ai >= 3920 && ai <= 3929)) { - return n1__15(data, data_len, p_err_no, p_err_posn, err_msg); + return n__15(data, data_len, p_err_no, p_err_posn, err_msg); } if ((ai >= 3910 && ai <= 3919) || (ai >= 3930 && ai <= 3939)) { - return n3_iso4217_n1__15(data, data_len, p_err_no, p_err_posn, err_msg); + return n3_iso4217_n__15(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai >= 3940 && ai <= 3943) { return n4(data, data_len, p_err_no, p_err_posn, err_msg); @@ -690,19 +700,22 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, } else if (ai < 4400) { if (ai == 4300 || ai == 4301 || ai == 4310 || ai == 4311 || ai == 4320) { - return x1__35_pcenc(data, data_len, p_err_no, p_err_posn, err_msg); + return x__35_pcenc(data, data_len, p_err_no, p_err_posn, err_msg); } if ((ai >= 4302 && ai <= 4306) || (ai >= 4312 && ai <= 4316)) { - return x1__70_pcenc(data, data_len, p_err_no, p_err_posn, err_msg); + return x__70_pcenc(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 4307 || ai == 4317) { return x2_iso3166alpha2(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 4308 || ai == 4319) { - return x1__30(data, data_len, p_err_no, p_err_posn, err_msg); + return x__30(data, data_len, p_err_no, p_err_posn, err_msg); + } + if (ai == 4309) { + return n20_latlong(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 4318) { - return x1__20(data, data_len, p_err_no, p_err_posn, err_msg); + return x__20(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai >= 4321 && ai <= 4323) { return n1_yesno(data, data_len, p_err_no, p_err_posn, err_msg); @@ -720,40 +733,40 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, return n13(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7002) { - return x1__30(data, data_len, p_err_no, p_err_posn, err_msg); + return x__30(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7003) { return n6_yymmdd_n4_hhmm(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7004) { - return n1__4(data, data_len, p_err_no, p_err_posn, err_msg); + return n__4(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7005) { - return x1__12(data, data_len, p_err_no, p_err_posn, err_msg); + return x__12(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7006) { return n6_yymmdd(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7007) { - return n6_yymmdd_n0__6_yymmdd(data, data_len, p_err_no, p_err_posn, err_msg); + return n6_yymmdd__n6__yymmdd(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7008) { - return x1__3(data, data_len, p_err_no, p_err_posn, err_msg); + return x__3(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7009) { - return x1__10(data, data_len, p_err_no, p_err_posn, err_msg); + return x__10(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7010) { - return x1__2(data, data_len, p_err_no, p_err_posn, err_msg); + return x__2(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai >= 7020 && ai <= 7022) { - return x1__20(data, data_len, p_err_no, p_err_posn, err_msg); + return x__20(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7023) { - return x1__30_key(data, data_len, p_err_no, p_err_posn, err_msg); + return x__30_key(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai >= 7030 && ai <= 7039) { - return n3_iso3166999_x1__27(data, data_len, p_err_no, p_err_posn, err_msg); + return n3_iso3166999_x__27(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7040) { return n1_x1_x1_x1_importeridx(data, data_len, p_err_no, p_err_posn, err_msg); @@ -762,10 +775,10 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, } else if (ai < 7300) { if (ai >= 7230 && ai <= 7239) { - return x2_x1__28(data, data_len, p_err_no, p_err_posn, err_msg); + return x2_x__28(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 7240) { - return x1__20(data, data_len, p_err_no, p_err_posn, err_msg); + return x__20(data, data_len, p_err_no, p_err_posn, err_msg); } } else if (ai < 8100) { @@ -774,13 +787,13 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, return n4_nonzero_n5_nonzero_n3_nonzero_n1_winding_n1(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8002 || ai == 8012) { - return x1__20(data, data_len, p_err_no, p_err_posn, err_msg); + return x__20(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8003) { - return n1_zero_n13_csum_key_x0__16(data, data_len, p_err_no, p_err_posn, err_msg); + return n1_zero_n13_csum_key__x__16_(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8004) { - return x1__30_key(data, data_len, p_err_no, p_err_posn, err_msg); + return x__30_key(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8005) { return n6(data, data_len, p_err_no, p_err_posn, err_msg); @@ -789,49 +802,49 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, return n14_csum_n4_pieceoftotal(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8007) { - return x1__34_iban(data, data_len, p_err_no, p_err_posn, err_msg); + return x__34_iban(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8008) { - return n8_yymmddhh_n0__4_mmoptss(data, data_len, p_err_no, p_err_posn, err_msg); + return n8_yymmddhh__n__4__mmoptss(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8009) { - return x1__50(data, data_len, p_err_no, p_err_posn, err_msg); + return x__50(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8010) { - return c1__30_key(data, data_len, p_err_no, p_err_posn, err_msg); + return y__30_key(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8011) { - return n1__12_nozeroprefix(data, data_len, p_err_no, p_err_posn, err_msg); + return n__12_nozeroprefix(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8013) { - return x1__25_csumalpha_key(data, data_len, p_err_no, p_err_posn, err_msg); + return x__25_csumalpha_key(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8017 || ai == 8018) { return n18_csum(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8019) { - return n1__10(data, data_len, p_err_no, p_err_posn, err_msg); + return n__10(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8020) { - return x1__25(data, data_len, p_err_no, p_err_posn, err_msg); + return x__25(data, data_len, p_err_no, p_err_posn, err_msg); } } else if (ai < 8200) { if (ai == 8110) { - return x1__70_couponcode(data, data_len, p_err_no, p_err_posn, err_msg); + return x__70_couponcode(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8111) { return n4(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8112) { - return x1__70_couponposoffer(data, data_len, p_err_no, p_err_posn, err_msg); + return x__70_couponposoffer(data, data_len, p_err_no, p_err_posn, err_msg); } } else if (ai < 8300) { if (ai == 8200) { - return x1__70(data, data_len, p_err_no, p_err_posn, err_msg); + return x__70(data, data_len, p_err_no, p_err_posn, err_msg); } } @@ -840,4 +853,4 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, return 0; } -#endif /* GS1_LINT_H */ +#endif /* Z_GS1_LINT_H */ diff --git a/backend/iso4217.h b/backend/iso4217.h index 6959d17c..14b9e441 100644 --- a/backend/iso4217.h +++ b/backend/iso4217.h @@ -3,7 +3,7 @@ */ /* libzint - the open source barcode library - Copyright (C) 2021 Robin Stuart + Copyright (C) 2021-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -30,9 +30,10 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ISO4217_H -#define ISO4217_H +#ifndef Z_ISO4217_H +#define Z_ISO4217_H /* Whether ISO 4217-1 numeric */ static int iso4217_numeric(int cc) { @@ -51,7 +52,7 @@ static int iso4217_numeric(int cc) { 0x45, 0x00, 0x00, 0x01, 0x00, 0x10, 0x11, 0x11, 0x00, 0x11, 0x11, 0x00, 0x81, 0x00, 0x04, 0x04, 0x04, 0x01, 0x00, 0x14, 0x00, 0x00, 0x44, 0x00, - 0x20, 0x00, 0x00, 0x80, 0x7F, 0xB5, 0xFD, 0xFB, + 0x20, 0x00, 0x00, 0xA0, 0x7F, 0xB5, 0xFD, 0xFB, 0xBF, 0xBF, 0x3F, 0x47, 0xA4, }; int b = cc >> 3; @@ -62,4 +63,4 @@ static int iso4217_numeric(int cc) { return codes[b] & (1 << (cc & 0x7)) ? 1 : 0; } -#endif /* ISO4217_H */ +#endif /* Z_ISO4217_H */ diff --git a/backend/tests/test_gs1.c b/backend/tests/test_gs1.c index 1c6bb918..e04c4eaa 100644 --- a/backend/tests/test_gs1.c +++ b/backend/tests/test_gs1.c @@ -959,384 +959,386 @@ static void test_gs1_verify(int index, int debug) { /*602*/ { "[4308]1", 0, "43081" }, /*603*/ { "[4308]123456789012345678901234567890", 0, "4308123456789012345678901234567890" }, /*604*/ { "[4308]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*605*/ { "[4309]1", ZINT_ERROR_INVALID_DATA, "" }, - /*606*/ { "[431]1", ZINT_ERROR_INVALID_DATA, "" }, - /*607*/ { "[4310]1", 0, "43101" }, - /*608*/ { "[4310]12345678901234567890123456789012345", 0, "431012345678901234567890123456789012345" }, - /*609*/ { "[4310]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*610*/ { "[4311]1", 0, "43111" }, - /*611*/ { "[4311]12345678901234567890123456789012345", 0, "431112345678901234567890123456789012345" }, - /*612*/ { "[4311]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*613*/ { "[4312]1", 0, "43121" }, - /*614*/ { "[4312]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43121234567890123456789012345678901234567890123456789012345678901234567890" }, - /*615*/ { "[4312]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*616*/ { "[4313]1", 0, "43131" }, - /*617*/ { "[4313]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43131234567890123456789012345678901234567890123456789012345678901234567890" }, - /*618*/ { "[4313]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*619*/ { "[4314]1", 0, "43141" }, - /*620*/ { "[4314]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43141234567890123456789012345678901234567890123456789012345678901234567890" }, - /*621*/ { "[4314]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*622*/ { "[4315]1", 0, "43151" }, - /*623*/ { "[4315]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43151234567890123456789012345678901234567890123456789012345678901234567890" }, - /*624*/ { "[4315]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*625*/ { "[4316]1", 0, "43161" }, - /*626*/ { "[4316]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43161234567890123456789012345678901234567890123456789012345678901234567890" }, - /*627*/ { "[4316]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*628*/ { "[4317]FR", 0, "4317FR" }, - /*629*/ { "[4317]F", ZINT_ERROR_INVALID_DATA, "" }, - /*630*/ { "[4317]FRF", ZINT_ERROR_INVALID_DATA, "" }, - /*631*/ { "[4318]1", 0, "43181" }, - /*632*/ { "[4318]12345678901234567890", 0, "431812345678901234567890" }, - /*633*/ { "[4318]123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*634*/ { "[4319]1", 0, "43191" }, - /*635*/ { "[4319]123456789012345678901234567890", 0, "4319123456789012345678901234567890" }, - /*636*/ { "[4319]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*637*/ { "[432]1", ZINT_ERROR_INVALID_DATA, "" }, - /*638*/ { "[4320]1", 0, "43201" }, - /*639*/ { "[4320]12345678901234567890123456789012345", 0, "432012345678901234567890123456789012345" }, - /*640*/ { "[4320]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, - /*641*/ { "[4321]1", 0, "43211" }, - /*642*/ { "[4321]10", ZINT_ERROR_INVALID_DATA, "" }, - /*643*/ { "[4322]1", 0, "43221" }, - /*644*/ { "[4322]10", ZINT_ERROR_INVALID_DATA, "" }, - /*645*/ { "[4323]1", 0, "43231" }, - /*646*/ { "[4323]10", ZINT_ERROR_INVALID_DATA, "" }, - /*647*/ { "[4324]1212120000", 0, "43241212120000" }, - /*648*/ { "[4324]121212000", ZINT_ERROR_INVALID_DATA, "" }, - /*649*/ { "[4324]12121200000", ZINT_ERROR_INVALID_DATA, "" }, - /*650*/ { "[4325]1212120000", 0, "43251212120000" }, - /*651*/ { "[4325]121212000", ZINT_ERROR_INVALID_DATA, "" }, - /*652*/ { "[4325]12121200000", ZINT_ERROR_INVALID_DATA, "" }, - /*653*/ { "[4326]121212", 0, "4326121212" }, - /*654*/ { "[4326]12121", ZINT_ERROR_INVALID_DATA, "" }, - /*655*/ { "[4326]1212120", ZINT_ERROR_INVALID_DATA, "" }, - /*656*/ { "[4327]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*657*/ { "[4328]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*658*/ { "[4329]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*659*/ { "[433]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*660*/ { "[4330]121212", ZINT_ERROR_INVALID_DATA, "" }, - /*661*/ { "[44]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*662*/ { "[440]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*663*/ { "[4400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*664*/ { "[49]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*665*/ { "[490]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*666*/ { "[4900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*667*/ { "[499]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*668*/ { "[4990]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*669*/ { "[50]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*670*/ { "[500]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*671*/ { "[5000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*672*/ { "[51]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*673*/ { "[510]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*674*/ { "[5100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*675*/ { "[59]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*676*/ { "[590]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*677*/ { "[5900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*678*/ { "[60]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*679*/ { "[600]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*680*/ { "[6000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*681*/ { "[61]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*682*/ { "[610]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*683*/ { "[6100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*684*/ { "[69]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*685*/ { "[690]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*686*/ { "[6900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*687*/ { "[70]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*688*/ { "[700]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*689*/ { "[7000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*690*/ { "[7001]1234567890123", 0, "70011234567890123" }, - /*691*/ { "[7001]123456789012", ZINT_ERROR_INVALID_DATA, "" }, - /*692*/ { "[7002]abcdefghijklmnopqrstuvwxyz1234", 0, "7002abcdefghijklmnopqrstuvwxyz1234" }, - /*693*/ { "[7002]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*694*/ { "[7003]1212121212", 0, "70031212121212" }, - /*695*/ { "[7003]121212121", ZINT_ERROR_INVALID_DATA, "" }, - /*696*/ { "[7004]1234", 0, "70041234" }, - /*697*/ { "[7004]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*698*/ { "[7005]abcdefghijkl", 0, "7005abcdefghijkl" }, - /*699*/ { "[7005]abcdefghijklm", ZINT_ERROR_INVALID_DATA, "" }, - /*700*/ { "[7006]200132", ZINT_WARN_NONCOMPLIANT, "7006200132" }, - /*701*/ { "[7006]200100", ZINT_WARN_NONCOMPLIANT, "7006200100" }, - /*702*/ { "[7006]200120", 0, "7006200120" }, - /*703*/ { "[7006]2001320", ZINT_ERROR_INVALID_DATA, "" }, - /*704*/ { "[7007]010101121212", 0, "7007010101121212" }, - /*705*/ { "[7007]01010112121", ZINT_ERROR_INVALID_DATA, "" }, - /*706*/ { "[7007]A1010112121", ZINT_ERROR_INVALID_DATA, "" }, - /*707*/ { "[7007]121212", 0, "7007121212" }, - /*708*/ { "[7007]12121", ZINT_ERROR_INVALID_DATA, "" }, - /*709*/ { "[7007]1212121", ZINT_ERROR_INVALID_DATA, "" }, - /*710*/ { "[7008]abc", 0, "7008abc" }, - /*711*/ { "[7008]abcd", ZINT_ERROR_INVALID_DATA, "" }, - /*712*/ { "[7009]abcdefghij", 0, "7009abcdefghij" }, - /*713*/ { "[7009]abcdefghijk", ZINT_ERROR_INVALID_DATA, "" }, - /*714*/ { "[7010]01", 0, "701001" }, - /*715*/ { "[7010]1", 0, "70101" }, - /*716*/ { "[7010]012", ZINT_ERROR_INVALID_DATA, "" }, - /*717*/ { "[7011]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*718*/ { "[7012]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*719*/ { "[7019]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*720*/ { "[7020]abcdefghijklmnopqrst", 0, "7020abcdefghijklmnopqrst" }, - /*721*/ { "[7020]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*722*/ { "[7021]abcdefghijklmnopqrst", 0, "7021abcdefghijklmnopqrst" }, - /*723*/ { "[7021]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*724*/ { "[7022]abcdefghijklmnopqrst", 0, "7022abcdefghijklmnopqrst" }, - /*725*/ { "[7022]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*726*/ { "[7023]1234abcdefghijklmnopqrstuvwxyz", 0, "70231234abcdefghijklmnopqrstuvwxyz" }, - /*727*/ { "[7023]1234abcdefghijklmnopqrstuvwxyza", ZINT_ERROR_INVALID_DATA, "" }, - /*728*/ { "[7024]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*729*/ { "[7025]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*730*/ { "[7029]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*731*/ { "[7030]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7030123abcdefghijklmnopqrstuvwxyza" }, - /*732*/ { "[7030]004abcdefghijklmnopqrstuvwxyza", 0, "7030004abcdefghijklmnopqrstuvwxyza" }, - /*733*/ { "[7030]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*734*/ { "[7031]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7031123abcdefghijklmnopqrstuvwxyza" }, - /*735*/ { "[7031]004abcdefghijklmnopqrstuvwxyza", 0, "7031004abcdefghijklmnopqrstuvwxyza" }, - /*736*/ { "[7031]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*737*/ { "[7032]004abcdefghijklmnopqrstuvwxyza", 0, "7032004abcdefghijklmnopqrstuvwxyza" }, - /*738*/ { "[7032]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*739*/ { "[7033]004abcdefghijklmnopqrstuvwxyza", 0, "7033004abcdefghijklmnopqrstuvwxyza" }, - /*740*/ { "[7033]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*741*/ { "[7034]004abcdefghijklmnopqrstuvwxyza", 0, "7034004abcdefghijklmnopqrstuvwxyza" }, - /*742*/ { "[7034]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*743*/ { "[7035]004abcdefghijklmnopqrstuvwxyza", 0, "7035004abcdefghijklmnopqrstuvwxyza" }, - /*744*/ { "[7035]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*745*/ { "[7036]004abcdefghijklmnopqrstuvwxyza", 0, "7036004abcdefghijklmnopqrstuvwxyza" }, - /*746*/ { "[7036]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*747*/ { "[7037]004abcdefghijklmnopqrstuvwxyza", 0, "7037004abcdefghijklmnopqrstuvwxyza" }, - /*748*/ { "[7037]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*749*/ { "[7038]004abcdefghijklmnopqrstuvwxyza", 0, "7038004abcdefghijklmnopqrstuvwxyza" }, - /*750*/ { "[7038]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*751*/ { "[7039]004abcdefghijklmnopqrstuvwxyza", 0, "7039004abcdefghijklmnopqrstuvwxyza" }, - /*752*/ { "[7039]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, - /*753*/ { "[7040]1abc", 0, "70401abc" }, - /*754*/ { "[7040]1ab", ZINT_ERROR_INVALID_DATA, "" }, - /*755*/ { "[7040]1abcd", ZINT_ERROR_INVALID_DATA, "" }, - /*756*/ { "[7041]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*757*/ { "[7042]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*758*/ { "[7050]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*759*/ { "[7090]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*760*/ { "[7099]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*761*/ { "[71]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*762*/ { "[710]abcdefghijklmnopqrst", 0, "710abcdefghijklmnopqrst" }, - /*763*/ { "[710]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*764*/ { "[7100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*765*/ { "[711]abcdefghijklmnopqrst", 0, "711abcdefghijklmnopqrst" }, - /*766*/ { "[711]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*767*/ { "[712]abcdefghijklmnopqrst", 0, "712abcdefghijklmnopqrst" }, - /*768*/ { "[712]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*769*/ { "[713]abcdefghijklmnopqrst", 0, "713abcdefghijklmnopqrst" }, - /*770*/ { "[713]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*771*/ { "[714]abcdefghijklmnopqrst", 0, "714abcdefghijklmnopqrst" }, - /*772*/ { "[714]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*773*/ { "[715]abcdefghijklmnopqrst", 0, "715abcdefghijklmnopqrst" }, - /*774*/ { "[715]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*775*/ { "[716]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*776*/ { "[719]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*777*/ { "[72]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*778*/ { "[720]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*779*/ { "[7200]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*780*/ { "[721]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*781*/ { "[7210]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*782*/ { "[7220]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*783*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzab", 0, "7230EMabcdefghijklmnopqrstuvwxyzab" }, - /*784*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*785*/ { "[7230]EM", ZINT_ERROR_INVALID_DATA, "" }, - /*786*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzab", 0, "7231EMabcdefghijklmnopqrstuvwxyzab" }, - /*787*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*788*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzab", 0, "7232EMabcdefghijklmnopqrstuvwxyzab" }, - /*789*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*790*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzab", 0, "7233EMabcdefghijklmnopqrstuvwxyzab" }, - /*791*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*792*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzab", 0, "7234EMabcdefghijklmnopqrstuvwxyzab" }, - /*793*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*794*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzab", 0, "7235EMabcdefghijklmnopqrstuvwxyzab" }, - /*795*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*796*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzab", 0, "7236EMabcdefghijklmnopqrstuvwxyzab" }, - /*797*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*798*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzab", 0, "7237EMabcdefghijklmnopqrstuvwxyzab" }, - /*799*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*800*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzab", 0, "7238EMabcdefghijklmnopqrstuvwxyzab" }, - /*801*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*802*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzab", 0, "7239EMabcdefghijklmnopqrstuvwxyzab" }, - /*803*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, - /*804*/ { "[7239]E", ZINT_ERROR_INVALID_DATA, "" }, - /*805*/ { "[7240]abcdefghijklmnopqrst", 0, "7240abcdefghijklmnopqrst" }, - /*806*/ { "[7240]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*807*/ { "[7241]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*808*/ { "[7249]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*809*/ { "[7250]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*810*/ { "[7299]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*811*/ { "[73]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*812*/ { "[7300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*813*/ { "[74]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*814*/ { "[7400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*815*/ { "[79]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*816*/ { "[7900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*817*/ { "[7999]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*818*/ { "[80]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*819*/ { "[800]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*820*/ { "[8000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*821*/ { "[8001]12345678901234", ZINT_WARN_NONCOMPLIANT, "800112345678901234" }, - /*822*/ { "[8001]12345678901204", 0, "800112345678901204" }, - /*823*/ { "[8001]1234123456789012345", ZINT_ERROR_INVALID_DATA, "" }, - /*824*/ { "[8002]abcdefghijklmnopqrst", 0, "8002abcdefghijklmnopqrst" }, - /*825*/ { "[8002]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, - /*826*/ { "[8003]01234567890123abcdefghijklmnop", ZINT_WARN_NONCOMPLIANT, "800301234567890123abcdefghijklmnop" }, - /*827*/ { "[8003]01234567890128abcdefghijklmnop", 0, "800301234567890128abcdefghijklmnop" }, - /*828*/ { "[8003]01234567890128abcdefghijklmnopq", ZINT_ERROR_INVALID_DATA, "" }, - /*829*/ { "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_WARN_NONCOMPLIANT, "8004abcdefghijklmnopqrstuvwxyz1234" }, - /*830*/ { "[8004]12cdefghijklmnopqrstuvwxyz1234", 0, "800412cdefghijklmnopqrstuvwxyz1234" }, - /*831*/ { "[8004]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*832*/ { "[8005]123456", 0, "8005123456" }, - /*833*/ { "[8005]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*834*/ { "[8005]1234567", ZINT_ERROR_INVALID_DATA, "" }, - /*835*/ { "[8006]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8006123456789012341212" }, - /*836*/ { "[8006]123456789012311212", 0, "8006123456789012311212" }, - /*837*/ { "[8006]12345678901234121", ZINT_ERROR_INVALID_DATA, "" }, - /*838*/ { "[8006]1234567890123412123", ZINT_ERROR_INVALID_DATA, "" }, - /*839*/ { "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_WARN_NONCOMPLIANT, "8007abcdefghijklmnopqrstuvwxyz12345678" }, - /*840*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678" }, - /*841*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ123456789", ZINT_ERROR_INVALID_DATA, "" }, - /*842*/ { "[8008]123456121212", ZINT_WARN_NONCOMPLIANT, "8008123456121212" }, - /*843*/ { "[8008]121256121212", ZINT_WARN_NONCOMPLIANT, "8008121256121212" }, - /*844*/ { "[8008]121231121212", 0, "8008121231121212" }, - /*845*/ { "[8008]1234561212", ZINT_WARN_NONCOMPLIANT, "80081234561212" }, - /*846*/ { "[8008]1212311212", 0, "80081212311212" }, - /*847*/ { "[8008]12345612", ZINT_WARN_NONCOMPLIANT, "800812345612" }, - /*848*/ { "[8008]12010112", 0, "800812010112" }, - /*849*/ { "[8008]1234561", ZINT_ERROR_INVALID_DATA, "" }, - /*850*/ { "[8008]123456121", ZINT_ERROR_INVALID_DATA, "" }, - /*851*/ { "[8008]12345612121", ZINT_ERROR_INVALID_DATA, "" }, - /*852*/ { "[8008]1234561212123", ZINT_ERROR_INVALID_DATA, "" }, - /*853*/ { "[8009]12345678901234567890123456789012345678901234567890", 0, "800912345678901234567890123456789012345678901234567890" }, - /*854*/ { "[8009]123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*855*/ { "[8010]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" }, - /*856*/ { "[8011]123456789012", 0, "8011123456789012" }, - /*857*/ { "[8011]1234567890123", ZINT_ERROR_INVALID_DATA, "" }, - /*858*/ { "[8012]abcdefghijklmnopqrst", 0, "8012abcdefghijklmnopqrst" }, - /*859*/ { "[8012]abcdefghijklmnopqrstuv", ZINT_ERROR_INVALID_DATA, "" }, - /*860*/ { "[8013]1234abcdefghijklmnopqrsQP", 0, "80131234abcdefghijklmnopqrsQP" }, - /*861*/ { "[8013]1234abcdefghijklmnopqrsQPv", ZINT_ERROR_INVALID_DATA, "" }, - /*862*/ { "[8014]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*863*/ { "[8016]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*864*/ { "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139" }, - /*865*/ { "[8017]313131313131313131", 0, "8017313131313131313131" }, - /*866*/ { "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, - /*867*/ { "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, - /*868*/ { "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139" }, - /*869*/ { "[8018]313131313131313131", 0, "8018313131313131313131" }, - /*870*/ { "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, - /*871*/ { "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, - /*872*/ { "[8019]1234567890", 0, "80191234567890" }, - /*873*/ { "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*874*/ { "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy" }, - /*875*/ { "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "" }, - /*876*/ { "[8021]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*877*/ { "[8025]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*878*/ { "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212" }, - /*879*/ { "[8026]123456789012311212", 0, "8026123456789012311212" }, - /*880*/ { "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "" }, - /*881*/ { "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "" }, - /*882*/ { "[8027]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*883*/ { "[8030]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*884*/ { "[8040]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*885*/ { "[8050]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*886*/ { "[8060]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*887*/ { "[8070]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*888*/ { "[8080]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*889*/ { "[8090]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*890*/ { "[8099]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*891*/ { "[81]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*892*/ { "[8100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*893*/ { "[8109]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*894*/ { "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000" }, - /*895*/ { "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "" }, - /*896*/ { "[8111]1234", 0, "81111234" }, - /*897*/ { "[8111]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*898*/ { "[8111]123", ZINT_ERROR_INVALID_DATA, "" }, - /*899*/ { "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890" }, - /*900*/ { "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*901*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345" }, - /*902*/ { "[8113]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*903*/ { "[8120]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*904*/ { "[8130]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*905*/ { "[8140]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*906*/ { "[8150]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*907*/ { "[8190]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*908*/ { "[8199]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*909*/ { "[82]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*910*/ { "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890" }, - /*911*/ { "[8201]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*912*/ { "[8210]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*913*/ { "[8220]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*914*/ { "[8230]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*915*/ { "[8240]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*916*/ { "[8250]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*917*/ { "[8290]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*918*/ { "[8299]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*919*/ { "[83]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*920*/ { "[830]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*921*/ { "[8300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*922*/ { "[84]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*923*/ { "[840]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*924*/ { "[8400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*925*/ { "[85]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*926*/ { "[850]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*927*/ { "[8500]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*928*/ { "[89]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*929*/ { "[890]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*930*/ { "[8900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*931*/ { "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234" }, - /*932*/ { "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*933*/ { "[900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*934*/ { "[9000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*935*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*936*/ { "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*937*/ { "[910]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*938*/ { "[9100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*939*/ { "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*940*/ { "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*941*/ { "[920]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*942*/ { "[9200]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*943*/ { "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*944*/ { "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*945*/ { "[930]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*946*/ { "[9300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*947*/ { "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*948*/ { "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*949*/ { "[940]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*950*/ { "[9400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*951*/ { "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*952*/ { "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*953*/ { "[950]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*954*/ { "[9500]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*955*/ { "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*956*/ { "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*957*/ { "[960]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*958*/ { "[9600]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*959*/ { "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*960*/ { "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*961*/ { "[970]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*962*/ { "[9700]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*963*/ { "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*964*/ { "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*965*/ { "[980]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*966*/ { "[9800]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*967*/ { "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*968*/ { "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*969*/ { "[990]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*970*/ { "[9900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*971*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*972*/ { "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101" }, - /*973*/ { "[01]12345678901231[7006]200101", 0, "01123456789012317006200101" }, - /*974*/ { "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890[0112345678901234" }, - /*975*/ { "[3900]1234567890[01]12345678901231", 0, "39001234567890[0112345678901231" }, - /*976*/ { "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[390112345678901234[2012" }, - /*977*/ { "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284[390112345678901234[2012" }, - /*978*/ { "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[0112345678901234390112345678901234[2012" }, - /*979*/ { "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284[0112345678901231390112345678901234[2012" }, - /*980*/ { "[01]12345678901231[0A]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" }, - /*981*/ { "[01]12345678901231[0]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" }, - /*982*/ { "[01]12345678901231[]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" }, + /*605*/ { "[4309]12345678901234567890", 0, "430912345678901234567890" }, + /*606*/ { "[4309]1234567890123456789", ZINT_ERROR_INVALID_DATA, "" }, + /*607*/ { "[4309]1234567890123456789A", ZINT_WARN_NONCOMPLIANT, "43091234567890123456789A" }, + /*608*/ { "[431]1", ZINT_ERROR_INVALID_DATA, "" }, + /*609*/ { "[4310]1", 0, "43101" }, + /*610*/ { "[4310]12345678901234567890123456789012345", 0, "431012345678901234567890123456789012345" }, + /*611*/ { "[4310]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*612*/ { "[4311]1", 0, "43111" }, + /*613*/ { "[4311]12345678901234567890123456789012345", 0, "431112345678901234567890123456789012345" }, + /*614*/ { "[4311]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*615*/ { "[4312]1", 0, "43121" }, + /*616*/ { "[4312]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43121234567890123456789012345678901234567890123456789012345678901234567890" }, + /*617*/ { "[4312]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*618*/ { "[4313]1", 0, "43131" }, + /*619*/ { "[4313]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43131234567890123456789012345678901234567890123456789012345678901234567890" }, + /*620*/ { "[4313]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*621*/ { "[4314]1", 0, "43141" }, + /*622*/ { "[4314]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43141234567890123456789012345678901234567890123456789012345678901234567890" }, + /*623*/ { "[4314]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*624*/ { "[4315]1", 0, "43151" }, + /*625*/ { "[4315]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43151234567890123456789012345678901234567890123456789012345678901234567890" }, + /*626*/ { "[4315]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*627*/ { "[4316]1", 0, "43161" }, + /*628*/ { "[4316]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "43161234567890123456789012345678901234567890123456789012345678901234567890" }, + /*629*/ { "[4316]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*630*/ { "[4317]FR", 0, "4317FR" }, + /*631*/ { "[4317]F", ZINT_ERROR_INVALID_DATA, "" }, + /*632*/ { "[4317]FRF", ZINT_ERROR_INVALID_DATA, "" }, + /*633*/ { "[4318]1", 0, "43181" }, + /*634*/ { "[4318]12345678901234567890", 0, "431812345678901234567890" }, + /*635*/ { "[4318]123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*636*/ { "[4319]1", 0, "43191" }, + /*637*/ { "[4319]123456789012345678901234567890", 0, "4319123456789012345678901234567890" }, + /*638*/ { "[4319]1234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*639*/ { "[432]1", ZINT_ERROR_INVALID_DATA, "" }, + /*640*/ { "[4320]1", 0, "43201" }, + /*641*/ { "[4320]12345678901234567890123456789012345", 0, "432012345678901234567890123456789012345" }, + /*642*/ { "[4320]123456789012345678901234567890123456", ZINT_ERROR_INVALID_DATA, "" }, + /*643*/ { "[4321]1", 0, "43211" }, + /*644*/ { "[4321]10", ZINT_ERROR_INVALID_DATA, "" }, + /*645*/ { "[4322]1", 0, "43221" }, + /*646*/ { "[4322]10", ZINT_ERROR_INVALID_DATA, "" }, + /*647*/ { "[4323]1", 0, "43231" }, + /*648*/ { "[4323]10", ZINT_ERROR_INVALID_DATA, "" }, + /*649*/ { "[4324]1212120000", 0, "43241212120000" }, + /*650*/ { "[4324]121212000", ZINT_ERROR_INVALID_DATA, "" }, + /*651*/ { "[4324]12121200000", ZINT_ERROR_INVALID_DATA, "" }, + /*652*/ { "[4325]1212120000", 0, "43251212120000" }, + /*653*/ { "[4325]121212000", ZINT_ERROR_INVALID_DATA, "" }, + /*654*/ { "[4325]12121200000", ZINT_ERROR_INVALID_DATA, "" }, + /*655*/ { "[4326]121212", 0, "4326121212" }, + /*656*/ { "[4326]12121", ZINT_ERROR_INVALID_DATA, "" }, + /*657*/ { "[4326]1212120", ZINT_ERROR_INVALID_DATA, "" }, + /*658*/ { "[4327]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*659*/ { "[4328]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*660*/ { "[4329]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*661*/ { "[433]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*662*/ { "[4330]121212", ZINT_ERROR_INVALID_DATA, "" }, + /*663*/ { "[44]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*664*/ { "[440]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*665*/ { "[4400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*666*/ { "[49]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*667*/ { "[490]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*668*/ { "[4900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*669*/ { "[499]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*670*/ { "[4990]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*671*/ { "[50]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*672*/ { "[500]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*673*/ { "[5000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*674*/ { "[51]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*675*/ { "[510]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*676*/ { "[5100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*677*/ { "[59]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*678*/ { "[590]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*679*/ { "[5900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*680*/ { "[60]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*681*/ { "[600]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*682*/ { "[6000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*683*/ { "[61]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*684*/ { "[610]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*685*/ { "[6100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*686*/ { "[69]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*687*/ { "[690]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*688*/ { "[6900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*689*/ { "[70]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*690*/ { "[700]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*691*/ { "[7000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*692*/ { "[7001]1234567890123", 0, "70011234567890123" }, + /*693*/ { "[7001]123456789012", ZINT_ERROR_INVALID_DATA, "" }, + /*694*/ { "[7002]abcdefghijklmnopqrstuvwxyz1234", 0, "7002abcdefghijklmnopqrstuvwxyz1234" }, + /*695*/ { "[7002]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*696*/ { "[7003]1212121212", 0, "70031212121212" }, + /*697*/ { "[7003]121212121", ZINT_ERROR_INVALID_DATA, "" }, + /*698*/ { "[7004]1234", 0, "70041234" }, + /*699*/ { "[7004]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*700*/ { "[7005]abcdefghijkl", 0, "7005abcdefghijkl" }, + /*701*/ { "[7005]abcdefghijklm", ZINT_ERROR_INVALID_DATA, "" }, + /*702*/ { "[7006]200132", ZINT_WARN_NONCOMPLIANT, "7006200132" }, + /*703*/ { "[7006]200100", ZINT_WARN_NONCOMPLIANT, "7006200100" }, + /*704*/ { "[7006]200120", 0, "7006200120" }, + /*705*/ { "[7006]2001320", ZINT_ERROR_INVALID_DATA, "" }, + /*706*/ { "[7007]010101121212", 0, "7007010101121212" }, + /*707*/ { "[7007]01010112121", ZINT_ERROR_INVALID_DATA, "" }, + /*708*/ { "[7007]A1010112121", ZINT_ERROR_INVALID_DATA, "" }, + /*709*/ { "[7007]121212", 0, "7007121212" }, + /*710*/ { "[7007]12121", ZINT_ERROR_INVALID_DATA, "" }, + /*711*/ { "[7007]1212121", ZINT_ERROR_INVALID_DATA, "" }, + /*712*/ { "[7008]abc", 0, "7008abc" }, + /*713*/ { "[7008]abcd", ZINT_ERROR_INVALID_DATA, "" }, + /*714*/ { "[7009]abcdefghij", 0, "7009abcdefghij" }, + /*715*/ { "[7009]abcdefghijk", ZINT_ERROR_INVALID_DATA, "" }, + /*716*/ { "[7010]01", 0, "701001" }, + /*717*/ { "[7010]1", 0, "70101" }, + /*718*/ { "[7010]012", ZINT_ERROR_INVALID_DATA, "" }, + /*719*/ { "[7011]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*720*/ { "[7012]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*721*/ { "[7019]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*722*/ { "[7020]abcdefghijklmnopqrst", 0, "7020abcdefghijklmnopqrst" }, + /*723*/ { "[7020]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*724*/ { "[7021]abcdefghijklmnopqrst", 0, "7021abcdefghijklmnopqrst" }, + /*725*/ { "[7021]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*726*/ { "[7022]abcdefghijklmnopqrst", 0, "7022abcdefghijklmnopqrst" }, + /*727*/ { "[7022]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*728*/ { "[7023]1234abcdefghijklmnopqrstuvwxyz", 0, "70231234abcdefghijklmnopqrstuvwxyz" }, + /*729*/ { "[7023]1234abcdefghijklmnopqrstuvwxyza", ZINT_ERROR_INVALID_DATA, "" }, + /*730*/ { "[7024]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*731*/ { "[7025]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*732*/ { "[7029]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*733*/ { "[7030]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7030123abcdefghijklmnopqrstuvwxyza" }, + /*734*/ { "[7030]004abcdefghijklmnopqrstuvwxyza", 0, "7030004abcdefghijklmnopqrstuvwxyza" }, + /*735*/ { "[7030]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*736*/ { "[7031]123abcdefghijklmnopqrstuvwxyza", ZINT_WARN_NONCOMPLIANT, "7031123abcdefghijklmnopqrstuvwxyza" }, + /*737*/ { "[7031]004abcdefghijklmnopqrstuvwxyza", 0, "7031004abcdefghijklmnopqrstuvwxyza" }, + /*738*/ { "[7031]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*739*/ { "[7032]004abcdefghijklmnopqrstuvwxyza", 0, "7032004abcdefghijklmnopqrstuvwxyza" }, + /*740*/ { "[7032]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*741*/ { "[7033]004abcdefghijklmnopqrstuvwxyza", 0, "7033004abcdefghijklmnopqrstuvwxyza" }, + /*742*/ { "[7033]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*743*/ { "[7034]004abcdefghijklmnopqrstuvwxyza", 0, "7034004abcdefghijklmnopqrstuvwxyza" }, + /*744*/ { "[7034]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*745*/ { "[7035]004abcdefghijklmnopqrstuvwxyza", 0, "7035004abcdefghijklmnopqrstuvwxyza" }, + /*746*/ { "[7035]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*747*/ { "[7036]004abcdefghijklmnopqrstuvwxyza", 0, "7036004abcdefghijklmnopqrstuvwxyza" }, + /*748*/ { "[7036]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*749*/ { "[7037]004abcdefghijklmnopqrstuvwxyza", 0, "7037004abcdefghijklmnopqrstuvwxyza" }, + /*750*/ { "[7037]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*751*/ { "[7038]004abcdefghijklmnopqrstuvwxyza", 0, "7038004abcdefghijklmnopqrstuvwxyza" }, + /*752*/ { "[7038]004abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*753*/ { "[7039]004abcdefghijklmnopqrstuvwxyza", 0, "7039004abcdefghijklmnopqrstuvwxyza" }, + /*754*/ { "[7039]123abcdefghijklmnopqrstuvwxyzab", ZINT_ERROR_INVALID_DATA, "" }, + /*755*/ { "[7040]1abc", 0, "70401abc" }, + /*756*/ { "[7040]1ab", ZINT_ERROR_INVALID_DATA, "" }, + /*757*/ { "[7040]1abcd", ZINT_ERROR_INVALID_DATA, "" }, + /*758*/ { "[7041]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*759*/ { "[7042]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*760*/ { "[7050]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*761*/ { "[7090]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*762*/ { "[7099]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*763*/ { "[71]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*764*/ { "[710]abcdefghijklmnopqrst", 0, "710abcdefghijklmnopqrst" }, + /*765*/ { "[710]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*766*/ { "[7100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*767*/ { "[711]abcdefghijklmnopqrst", 0, "711abcdefghijklmnopqrst" }, + /*768*/ { "[711]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*769*/ { "[712]abcdefghijklmnopqrst", 0, "712abcdefghijklmnopqrst" }, + /*770*/ { "[712]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*771*/ { "[713]abcdefghijklmnopqrst", 0, "713abcdefghijklmnopqrst" }, + /*772*/ { "[713]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*773*/ { "[714]abcdefghijklmnopqrst", 0, "714abcdefghijklmnopqrst" }, + /*774*/ { "[714]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*775*/ { "[715]abcdefghijklmnopqrst", 0, "715abcdefghijklmnopqrst" }, + /*776*/ { "[715]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*777*/ { "[716]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*778*/ { "[719]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*779*/ { "[72]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*780*/ { "[720]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*781*/ { "[7200]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*782*/ { "[721]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*783*/ { "[7210]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*784*/ { "[7220]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*785*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzab", 0, "7230EMabcdefghijklmnopqrstuvwxyzab" }, + /*786*/ { "[7230]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*787*/ { "[7230]EM", ZINT_ERROR_INVALID_DATA, "" }, + /*788*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzab", 0, "7231EMabcdefghijklmnopqrstuvwxyzab" }, + /*789*/ { "[7231]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*790*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzab", 0, "7232EMabcdefghijklmnopqrstuvwxyzab" }, + /*791*/ { "[7232]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*792*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzab", 0, "7233EMabcdefghijklmnopqrstuvwxyzab" }, + /*793*/ { "[7233]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*794*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzab", 0, "7234EMabcdefghijklmnopqrstuvwxyzab" }, + /*795*/ { "[7234]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*796*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzab", 0, "7235EMabcdefghijklmnopqrstuvwxyzab" }, + /*797*/ { "[7235]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*798*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzab", 0, "7236EMabcdefghijklmnopqrstuvwxyzab" }, + /*799*/ { "[7236]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*800*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzab", 0, "7237EMabcdefghijklmnopqrstuvwxyzab" }, + /*801*/ { "[7237]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*802*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzab", 0, "7238EMabcdefghijklmnopqrstuvwxyzab" }, + /*803*/ { "[7238]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*804*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzab", 0, "7239EMabcdefghijklmnopqrstuvwxyzab" }, + /*805*/ { "[7239]EMabcdefghijklmnopqrstuvwxyzabc", ZINT_ERROR_INVALID_DATA, "" }, + /*806*/ { "[7239]E", ZINT_ERROR_INVALID_DATA, "" }, + /*807*/ { "[7240]abcdefghijklmnopqrst", 0, "7240abcdefghijklmnopqrst" }, + /*808*/ { "[7240]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*809*/ { "[7241]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*810*/ { "[7249]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*811*/ { "[7250]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*812*/ { "[7299]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*813*/ { "[73]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*814*/ { "[7300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*815*/ { "[74]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*816*/ { "[7400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*817*/ { "[79]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*818*/ { "[7900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*819*/ { "[7999]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*820*/ { "[80]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*821*/ { "[800]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*822*/ { "[8000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*823*/ { "[8001]12345678901234", ZINT_WARN_NONCOMPLIANT, "800112345678901234" }, + /*824*/ { "[8001]12345678901204", 0, "800112345678901204" }, + /*825*/ { "[8001]1234123456789012345", ZINT_ERROR_INVALID_DATA, "" }, + /*826*/ { "[8002]abcdefghijklmnopqrst", 0, "8002abcdefghijklmnopqrst" }, + /*827*/ { "[8002]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /*828*/ { "[8003]01234567890123abcdefghijklmnop", ZINT_WARN_NONCOMPLIANT, "800301234567890123abcdefghijklmnop" }, + /*829*/ { "[8003]01234567890128abcdefghijklmnop", 0, "800301234567890128abcdefghijklmnop" }, + /*830*/ { "[8003]01234567890128abcdefghijklmnopq", ZINT_ERROR_INVALID_DATA, "" }, + /*831*/ { "[8004]abcdefghijklmnopqrstuvwxyz1234", ZINT_WARN_NONCOMPLIANT, "8004abcdefghijklmnopqrstuvwxyz1234" }, + /*832*/ { "[8004]12cdefghijklmnopqrstuvwxyz1234", 0, "800412cdefghijklmnopqrstuvwxyz1234" }, + /*833*/ { "[8004]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*834*/ { "[8005]123456", 0, "8005123456" }, + /*835*/ { "[8005]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*836*/ { "[8005]1234567", ZINT_ERROR_INVALID_DATA, "" }, + /*837*/ { "[8006]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8006123456789012341212" }, + /*838*/ { "[8006]123456789012311212", 0, "8006123456789012311212" }, + /*839*/ { "[8006]12345678901234121", ZINT_ERROR_INVALID_DATA, "" }, + /*840*/ { "[8006]1234567890123412123", ZINT_ERROR_INVALID_DATA, "" }, + /*841*/ { "[8007]abcdefghijklmnopqrstuvwxyz12345678", ZINT_WARN_NONCOMPLIANT, "8007abcdefghijklmnopqrstuvwxyz12345678" }, + /*842*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ12345678", 0, "8007AD95EFGHIJKLMNOPQRSTUVWXYZ12345678" }, + /*843*/ { "[8007]AD95EFGHIJKLMNOPQRSTUVWXYZ123456789", ZINT_ERROR_INVALID_DATA, "" }, + /*844*/ { "[8008]123456121212", ZINT_WARN_NONCOMPLIANT, "8008123456121212" }, + /*845*/ { "[8008]121256121212", ZINT_WARN_NONCOMPLIANT, "8008121256121212" }, + /*846*/ { "[8008]121231121212", 0, "8008121231121212" }, + /*847*/ { "[8008]1234561212", ZINT_WARN_NONCOMPLIANT, "80081234561212" }, + /*848*/ { "[8008]1212311212", 0, "80081212311212" }, + /*849*/ { "[8008]12345612", ZINT_WARN_NONCOMPLIANT, "800812345612" }, + /*850*/ { "[8008]12010112", 0, "800812010112" }, + /*851*/ { "[8008]1234561", ZINT_ERROR_INVALID_DATA, "" }, + /*852*/ { "[8008]123456121", ZINT_ERROR_INVALID_DATA, "" }, + /*853*/ { "[8008]12345612121", ZINT_ERROR_INVALID_DATA, "" }, + /*854*/ { "[8008]1234561212123", ZINT_ERROR_INVALID_DATA, "" }, + /*855*/ { "[8009]12345678901234567890123456789012345678901234567890", 0, "800912345678901234567890123456789012345678901234567890" }, + /*856*/ { "[8009]123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*857*/ { "[8010]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" }, + /*858*/ { "[8011]123456789012", 0, "8011123456789012" }, + /*859*/ { "[8011]1234567890123", ZINT_ERROR_INVALID_DATA, "" }, + /*860*/ { "[8012]abcdefghijklmnopqrst", 0, "8012abcdefghijklmnopqrst" }, + /*861*/ { "[8012]abcdefghijklmnopqrstuv", ZINT_ERROR_INVALID_DATA, "" }, + /*862*/ { "[8013]1234abcdefghijklmnopqrsQP", 0, "80131234abcdefghijklmnopqrsQP" }, + /*863*/ { "[8013]1234abcdefghijklmnopqrsQPv", ZINT_ERROR_INVALID_DATA, "" }, + /*864*/ { "[8014]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*865*/ { "[8016]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*866*/ { "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139" }, + /*867*/ { "[8017]313131313131313131", 0, "8017313131313131313131" }, + /*868*/ { "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /*869*/ { "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, + /*870*/ { "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139" }, + /*871*/ { "[8018]313131313131313131", 0, "8018313131313131313131" }, + /*872*/ { "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /*873*/ { "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, + /*874*/ { "[8019]1234567890", 0, "80191234567890" }, + /*875*/ { "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*876*/ { "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy" }, + /*877*/ { "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "" }, + /*878*/ { "[8021]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*879*/ { "[8025]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*880*/ { "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212" }, + /*881*/ { "[8026]123456789012311212", 0, "8026123456789012311212" }, + /*882*/ { "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "" }, + /*883*/ { "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "" }, + /*884*/ { "[8027]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*885*/ { "[8030]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*886*/ { "[8040]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*887*/ { "[8050]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*888*/ { "[8060]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*889*/ { "[8070]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*890*/ { "[8080]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*891*/ { "[8090]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*892*/ { "[8099]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*893*/ { "[81]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*894*/ { "[8100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*895*/ { "[8109]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*896*/ { "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000" }, + /*897*/ { "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "" }, + /*898*/ { "[8111]1234", 0, "81111234" }, + /*899*/ { "[8111]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*900*/ { "[8111]123", ZINT_ERROR_INVALID_DATA, "" }, + /*901*/ { "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890" }, + /*902*/ { "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*903*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345" }, + /*904*/ { "[8113]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*905*/ { "[8120]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*906*/ { "[8130]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*907*/ { "[8140]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*908*/ { "[8150]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*909*/ { "[8190]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*910*/ { "[8199]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*911*/ { "[82]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*912*/ { "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890" }, + /*913*/ { "[8201]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*914*/ { "[8210]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*915*/ { "[8220]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*916*/ { "[8230]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*917*/ { "[8240]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*918*/ { "[8250]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*919*/ { "[8290]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*920*/ { "[8299]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*921*/ { "[83]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*922*/ { "[830]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*923*/ { "[8300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*924*/ { "[84]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*925*/ { "[840]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*926*/ { "[8400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*927*/ { "[85]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*928*/ { "[850]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*929*/ { "[8500]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*930*/ { "[89]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*931*/ { "[890]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*932*/ { "[8900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*933*/ { "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234" }, + /*934*/ { "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*935*/ { "[900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*936*/ { "[9000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*937*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*938*/ { "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*939*/ { "[910]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*940*/ { "[9100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*941*/ { "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*942*/ { "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*943*/ { "[920]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*944*/ { "[9200]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*945*/ { "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*946*/ { "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*947*/ { "[930]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*948*/ { "[9300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*949*/ { "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*950*/ { "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*951*/ { "[940]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*952*/ { "[9400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*953*/ { "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*954*/ { "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*955*/ { "[950]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*956*/ { "[9500]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*957*/ { "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*958*/ { "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*959*/ { "[960]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*960*/ { "[9600]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*961*/ { "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*962*/ { "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*963*/ { "[970]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*964*/ { "[9700]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*965*/ { "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*966*/ { "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*967*/ { "[980]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*968*/ { "[9800]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*969*/ { "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*970*/ { "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*971*/ { "[990]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*972*/ { "[9900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*973*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*974*/ { "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101" }, + /*975*/ { "[01]12345678901231[7006]200101", 0, "01123456789012317006200101" }, + /*976*/ { "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890[0112345678901234" }, + /*977*/ { "[3900]1234567890[01]12345678901231", 0, "39001234567890[0112345678901231" }, + /*978*/ { "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[390112345678901234[2012" }, + /*979*/ { "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284[390112345678901234[2012" }, + /*980*/ { "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[0112345678901234390112345678901234[2012" }, + /*981*/ { "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284[0112345678901231390112345678901234[2012" }, + /*982*/ { "[01]12345678901231[0A]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" }, + /*983*/ { "[01]12345678901231[0]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" }, + /*984*/ { "[01]12345678901231[]12345678901231[20]12", ZINT_ERROR_INVALID_DATA, "" }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -1554,203 +1556,207 @@ static void test_gs1_lint(int index, int debug) { /*172*/ { "[3910]0081", 0, "39100081", "" }, // iso4217 /*173*/ { "[3910]9991", 0, "39109991", "" }, // iso4217 /*174*/ { "[3910]9971", 0, "39109971", "" }, // iso4217 - /*175*/ { "[3910]01", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910)" }, // iso4217 - /*176*/ { "[3910]001", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910)" }, // iso4217 - /*177*/ { "[3910]9981", ZINT_WARN_NONCOMPLIANT, "39109981", "261: AI (3910) position 1: Unknown currency code '998'" }, // iso4217 - /*178*/ { "[3910]0041", ZINT_WARN_NONCOMPLIANT, "39100041", "261: AI (3910) position 1: Unknown currency code '004'" }, // iso4217 - /*179*/ { "[3910]8941", ZINT_WARN_NONCOMPLIANT, "39108941", "261: AI (3910) position 1: Unknown currency code '894'" }, // iso4217 - /*180*/ { "[4300]%12", 0, "4300%12", "" }, // pcenc - /*181*/ { "[4300]%1", ZINT_WARN_NONCOMPLIANT, "4300%1", "261: AI (4300) position 1: Invalid % escape" }, // pcenc - /*182*/ { "[4300]%", ZINT_WARN_NONCOMPLIANT, "4300%", "261: AI (4300) position 1: Invalid % escape" }, // pcenc - /*183*/ { "[4300]12%1212", 0, "430012%1212", "" }, // pcenc - /*184*/ { "[4300]12%1G12", ZINT_WARN_NONCOMPLIANT, "430012%1G12", "261: AI (4300) position 5: Invalid character for percent encoding" }, // pcenc - /*185*/ { "[4308]ABCDEFGHIJKLMNOPQRSTUVWXYZ%+12", 0, "4308ABCDEFGHIJKLMNOPQRSTUVWXYZ%+12", "" }, // no pcenc - /*186*/ { "[4308]ABCDEFGHIJKLMNOPQRSTUVWXYZ%+123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4308)" }, // no pcenc - /*187*/ { "[4321]1", 0, "43211", "" }, // yesno - /*188*/ { "[4321]0", 0, "43210", "" }, // yesno - /*189*/ { "[4321]2", ZINT_WARN_NONCOMPLIANT, "43212", "261: AI (4321) position 1: Neither 0 nor 1 for yes or no" }, // yesno - /*190*/ { "[4321]9", ZINT_WARN_NONCOMPLIANT, "43219", "261: AI (4321) position 1: Neither 0 nor 1 for yes or no" }, // yesno - /*191*/ { "[7040]1234", 0, "70401234", "" }, // importeridx - /*192*/ { "[7040]123A", 0, "7040123A", "" }, // importeridx - /*193*/ { "[7040]123Z", 0, "7040123Z", "" }, // importeridx - /*194*/ { "[7040]123a", 0, "7040123a", "" }, // importeridx - /*195*/ { "[7040]123z", 0, "7040123z", "" }, // importeridx - /*196*/ { "[7040]123-", 0, "7040123-", "" }, // importeridx - /*197*/ { "[7040]123_", 0, "7040123_", "" }, // importeridx - /*198*/ { "[7040]123!", ZINT_WARN_NONCOMPLIANT, "7040123!", "261: AI (7040) position 4: Invalid importer index '!'" }, // importeridx - /*199*/ { "[7040]123/", ZINT_WARN_NONCOMPLIANT, "7040123/", "261: AI (7040) position 4: Invalid importer index '/'" }, // importeridx - /*200*/ { "[7040]123:", ZINT_WARN_NONCOMPLIANT, "7040123:", "261: AI (7040) position 4: Invalid importer index ':'" }, // importeridx - /*201*/ { "[7040]123?", ZINT_WARN_NONCOMPLIANT, "7040123?", "261: AI (7040) position 4: Invalid importer index '?'" }, // importeridx - /*202*/ { "[8001]12341234512311", 0, "800112341234512311", "" }, // nonzero - /*203*/ { "[8001]00010000100100", 0, "800100010000100100", "" }, // nonzero - /*204*/ { "[8001]00001234512311", ZINT_WARN_NONCOMPLIANT, "800100001234512311", "261: AI (8001) position 1: Zero not permitted" }, // nonzero - /*205*/ { "[8001]12340000012311", ZINT_WARN_NONCOMPLIANT, "800112340000012311", "261: AI (8001) position 5: Zero not permitted" }, // nonzero - /*206*/ { "[8001]00010000100011", ZINT_WARN_NONCOMPLIANT, "800100010000100011", "261: AI (8001) position 10: Zero not permitted" }, // nonzero - /*207*/ { "[8001]00010000100101", 0, "800100010000100101", "" }, // winding - /*208*/ { "[8001]00010000100111", 0, "800100010000100111", "" }, // winding - /*209*/ { "[8001]00010000100191", 0, "800100010000100191", "" }, // winding - /*210*/ { "[8001]00010000100121", ZINT_WARN_NONCOMPLIANT, "800100010000100121", "261: AI (8001) position 13: Invalid winding direction '2'" }, // winding - /*211*/ { "[8001]00010000100131", ZINT_WARN_NONCOMPLIANT, "800100010000100131", "261: AI (8001) position 13: Invalid winding direction '3'" }, // winding - /*212*/ { "[8001]00010000100171", ZINT_WARN_NONCOMPLIANT, "800100010000100171", "261: AI (8001) position 13: Invalid winding direction '7'" }, // winding - /*213*/ { "[8001]00010000100181", ZINT_WARN_NONCOMPLIANT, "800100010000100181", "261: AI (8001) position 13: Invalid winding direction '8'" }, // winding - /*214*/ { "[8003]01234567890128", 0, "800301234567890128", "" }, // zero - /*215*/ { "[8003]11234567890128", ZINT_WARN_NONCOMPLIANT, "800311234567890128", "261: AI (8003) position 1: Zero is required" }, // zero - /*216*/ { "[8003]91234567890128", ZINT_WARN_NONCOMPLIANT, "800391234567890128", "261: AI (8003) position 1: Zero is required" }, // zero - /*217*/ { "[8006]123456789012310101", 0, "8006123456789012310101", "" }, // pieceoftotal - /*218*/ { "[8006]123456789012310199", 0, "8006123456789012310199", "" }, // pieceoftotal - /*219*/ { "[8006]123456789012319999", 0, "8006123456789012319999", "" }, // pieceoftotal - /*220*/ { "[8006]123456789012310001", ZINT_WARN_NONCOMPLIANT, "8006123456789012310001", "261: AI (8006) position 15: Piece number cannot be zero" }, // pieceoftotal - /*221*/ { "[8006]123456789012310100", ZINT_WARN_NONCOMPLIANT, "8006123456789012310100", "261: AI (8006) position 15: Total number cannot be zero" }, // pieceoftotal - /*222*/ { "[8006]123456789012310201", ZINT_WARN_NONCOMPLIANT, "8006123456789012310201", "261: AI (8006) position 15: Piece number '02' exceeds total '01'" }, // pieceoftotal - /*223*/ { "[8006]123456789012319998", ZINT_WARN_NONCOMPLIANT, "8006123456789012319998", "261: AI (8006) position 15: Piece number '99' exceeds total '98'" }, // pieceoftotal - /*224*/ { "[8007]GB82WEST12345698765432", 0, "8007GB82WEST12345698765432", "" }, // iban - /*225*/ { "[8007]GB83WEST12345698765432", ZINT_WARN_NONCOMPLIANT, "8007GB83WEST12345698765432", "261: AI (8007) position 3: Bad IBAN checksum '83', expected '82'" }, // iban - /*226*/ { "[8007]BE71096123456769", 0, "8007BE71096123456769", "" }, // iban - /*227*/ { "[8007]BE71096123456760", ZINT_WARN_NONCOMPLIANT, "8007BE71096123456760", "261: AI (8007) position 3: Bad IBAN checksum '71', expected '23'" }, // iban - /*228*/ { "[8007]BE01096123456760", ZINT_WARN_NONCOMPLIANT, "8007BE01096123456760", "261: AI (8007) position 3: Bad IBAN checksum '01', expected '23'" }, // iban - /*229*/ { "[8007]BE00096123456760", ZINT_WARN_NONCOMPLIANT, "8007BE00096123456760", "261: AI (8007) position 3: Bad IBAN checksum '00', expected '23'" }, // iban - /*230*/ { "[8007]LC14BOSL123456789012345678901234", 0, "8007LC14BOSL123456789012345678901234", "" }, // iban - /*231*/ { "[8007]LC14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007LC14BOSL123456789012345678901230", "261: AI (8007) position 3: Bad IBAN checksum '14', expected '25'" }, // iban - /*232*/ { "[8007]A114BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007A114BOSL123456789012345678901230", "261: AI (8007) position 1: Non-alphabetic IBAN country code 'A1'" }, // iban - /*233*/ { "[8007]1A14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "80071A14BOSL123456789012345678901230", "261: AI (8007) position 1: Non-alphabetic IBAN country code '1A'" }, // iban - /*234*/ { "[8007]AA14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007AA14BOSL123456789012345678901230", "261: AI (8007) position 1: Invalid IBAN country code 'AA'" }, // iban - /*235*/ { "[8007]ZZ14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZZ14BOSL123456789012345678901230", "261: AI (8007) position 1: Invalid IBAN country code 'ZZ'" }, // iban - /*236*/ { "[8007]ZW33BOSL123456789012345678901230", 0, "8007ZW33BOSL123456789012345678901230", "" }, // iban - /*237*/ { "[8007]ZWA3BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZWA3BOSL123456789012345678901230", "261: AI (8007) position 3: Non-numeric IBAN checksum 'A3'" }, // iban - /*238*/ { "[8007]ZW3ABOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZW3ABOSL123456789012345678901230", "261: AI (8007) position 3: Non-numeric IBAN checksum '3A'" }, // iban - /*239*/ { "[8007]ZW33bOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZW33bOSL123456789012345678901230", "261: AI (8007) position 5: Invalid IBAN character 'b'" }, // iban - /*240*/ { "[8007]GB98", ZINT_WARN_NONCOMPLIANT, "8007GB98", "259: Invalid data length for AI (8007)" }, // iban - /*241*/ { "[8007]FR7630006000011234567890189", 0, "8007FR7630006000011234567890189", "" }, // iban - /*242*/ { "[8007]DE91100000000123456789", 0, "8007DE91100000000123456789", "" }, // iban - /*243*/ { "[8007]GR9608100010000001234567890", 0, "8007GR9608100010000001234567890", "" }, // iban - /*244*/ { "[8007]MU43BOMM0101123456789101000MUR", 0, "8007MU43BOMM0101123456789101000MUR", "" }, // iban - /*245*/ { "[8007]PL10105000997603123456789123", 0, "8007PL10105000997603123456789123", "" }, // iban - /*246*/ { "[8007]RO09BCYP0000001234567890", 0, "8007RO09BCYP0000001234567890", "" }, // iban - /*247*/ { "[8007]SA4420000001234567891234", 0, "8007SA4420000001234567891234", "" }, // iban - /*248*/ { "[8007]ES7921000813610123456789", 0, "8007ES7921000813610123456789", "" }, // iban - /*249*/ { "[8007]CH5604835012345678009", 0, "8007CH5604835012345678009", "" }, // iban - /*250*/ { "[8007]GB98MIDL07009312345678", 0, "8007GB98MIDL07009312345678", "" }, // iban - /*251*/ { "[8011]1", 0, "80111", "" }, // nozeroprefix - /*252*/ { "[8011]11", 0, "801111", "" }, // nozeroprefix - /*253*/ { "[8011]0", 0, "80110", "" }, // nozeroprefix - /*254*/ { "[8011]01", ZINT_WARN_NONCOMPLIANT, "801101", "261: AI (8011) position 1: Zero prefix is not permitted" }, // nozeroprefix - /*255*/ { "[8110]106141416543213150110120", 0, "8110106141416543213150110120", "" }, // couponcode (first part of NACAG Appendix C: Example 1 - see test_rss.c test_examples) - /*256*/ { "[8110]012345612345610104123", 0, "8110012345612345610104123", "" }, // couponcode - /*257*/ { "[8110]01234561234561010412", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412", "259: Invalid data length for AI (8110)" }, // couponcode - /*258*/ { "[8110]12345678901234567890", ZINT_WARN_NONCOMPLIANT, "811012345678901234567890", "259: Invalid data length for AI (8110)" }, // couponcode - /*259*/ { "[8110]712345612345610104123", ZINT_WARN_NONCOMPLIANT, "8110712345612345610104123", "261: AI (8110) position 1: Invalid Primary GS1 Co. Prefix VLI '7'" }, // couponcode - /*260*/ { "[8110]A12345612345610104123", ZINT_WARN_NONCOMPLIANT, "8110A12345612345610104123", "261: AI (8110) position 1: Non-numeric Primary GS1 Co. Prefix VLI 'A'" }, // couponcode - /*261*/ { "[8110]012345A12345610104123", ZINT_WARN_NONCOMPLIANT, "8110012345A12345610104123", "261: AI (8110) position 7: Non-numeric Primary GS1 Co. Prefix 'A'" }, // couponcode - /*262*/ { "[8110]012345612345A10104123", ZINT_WARN_NONCOMPLIANT, "8110012345612345A10104123", "261: AI (8110) position 8: Non-numeric Offer Code" }, // couponcode - /*263*/ { "[8110]012345612345600104123", ZINT_WARN_NONCOMPLIANT, "8110012345612345600104123", "261: AI (8110) position 14: Invalid Save Value VLI '0'" }, // couponcode - /*264*/ { "[8110]012345612345660104123", ZINT_WARN_NONCOMPLIANT, "8110012345612345660104123", "261: AI (8110) position 14: Invalid Save Value VLI '6'" }, // couponcode - /*265*/ { "[8110]01234561234561A104123", ZINT_WARN_NONCOMPLIANT, "811001234561234561A104123", "261: AI (8110) position 15: Non-numeric Save Value 'A'" }, // couponcode - /*266*/ { "[8110]012345612345610004123", ZINT_WARN_NONCOMPLIANT, "8110012345612345610004123", "261: AI (8110) position 16: Invalid Primary Purch. Req. VLI '0'" }, // couponcode - /*267*/ { "[8110]012345612345610604123", ZINT_WARN_NONCOMPLIANT, "8110012345612345610604123", "261: AI (8110) position 16: Invalid Primary Purch. Req. VLI '6'" }, // couponcode - /*268*/ { "[8110]0123456123456101A4123", ZINT_WARN_NONCOMPLIANT, "81100123456123456101A4123", "261: AI (8110) position 17: Non-numeric Primary Purch. Req. 'A'" }, // couponcode - /*269*/ { "[8110]012345612345621251234", ZINT_WARN_NONCOMPLIANT, "8110012345612345621251234", "261: AI (8110) position 18: Primary Purch. Req. incomplete" }, // couponcode - /*270*/ { "[8110]01234561234561010A123", ZINT_WARN_NONCOMPLIANT, "811001234561234561010A123", "261: AI (8110) position 18: Non-numeric Primary Purch. Req. Code" }, // couponcode - /*271*/ { "[8110]012345612345610106123", ZINT_WARN_NONCOMPLIANT, "8110012345612345610106123", "261: AI (8110) position 18: Invalid Primary Purch. Req. Code '6'" }, // couponcode - /*272*/ { "[8110]012345612345610212412", ZINT_WARN_NONCOMPLIANT, "8110012345612345610212412", "261: AI (8110) position 20: Primary Purch. Family Code incomplete" }, // couponcode - /*273*/ { "[8110]0123456123456103123412", ZINT_WARN_NONCOMPLIANT, "81100123456123456103123412", "261: AI (8110) position 21: Primary Purch. Family Code incomplete" }, // couponcode - /*274*/ { "[8110]0123456123456103123412A", ZINT_WARN_NONCOMPLIANT, "81100123456123456103123412A", "261: AI (8110) position 21: Non-numeric Primary Purch. Family Code" }, // couponcode - /*275*/ { "[8110]01234561234561031234123", 0, "811001234561234561031234123", "" }, // couponcode - /*276*/ { "[8110]612345678901212345651", ZINT_WARN_NONCOMPLIANT, "8110612345678901212345651", "261: AI (8110) position 21: Save Value incomplete" }, // couponcode - /*277*/ { "[8110]6123456789012123456512345", ZINT_WARN_NONCOMPLIANT, "81106123456789012123456512345", "261: AI (8110) position 26: Primary Purch. Req. VLI missing" }, // couponcode - /*278*/ { "[8110]61234567890121234565123455123454123", 0, "811061234567890121234565123455123454123", "" }, // couponcode - /*279*/ { "[8110]61234567890121234565123455123454123A", ZINT_WARN_NONCOMPLIANT, "811061234567890121234565123455123454123A", "261: AI (8110) position 36: Non-numeric Data Field 'A'" }, // couponcode - /*280*/ { "[8110]612345678901212345651234551234541237", ZINT_WARN_NONCOMPLIANT, "8110612345678901212345651234551234541237", "261: AI (8110) position 36: Invalid Data Field '7'" }, // couponcode - /*281*/ { "[8110]612345678901212345651234551234541238", ZINT_WARN_NONCOMPLIANT, "8110612345678901212345651234551234541238", "261: AI (8110) position 36: Invalid Data Field '8'" }, // couponcode - /*282*/ { "[8110]0123456123456101041231", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231", "261: AI (8110) position 23: Add. Purch. Rules Code incomplete" }, // couponcode - /*283*/ { "[8110]0123456123456101041231A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231A", "261: AI (8110) position 23: Non-numeric Add. Purch. Rules Code" }, // couponcode - /*284*/ { "[8110]01234561234561010412314", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412314", "261: AI (8110) position 23: Invalid Add. Purch. Rules Code '4'" }, // couponcode - /*285*/ { "[8110]01234561234561010412313", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313", "261: AI (8110) position 24: 2nd Purch. Req. VLI missing" }, // couponcode - /*286*/ { "[8110]01234561234561010412313A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313A", "261: AI (8110) position 24: Non-numeric 2nd Purch. Req. VLI 'A'" }, // couponcode - /*287*/ { "[8110]012345612345610104123130", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123130", "261: AI (8110) position 24: Invalid 2nd Purch. Req. VLI '0'" }, // couponcode - /*288*/ { "[8110]012345612345610104123131", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123131", "261: AI (8110) position 25: 2nd Purch. Req. incomplete" }, // couponcode - /*289*/ { "[8110]012345612345610104123131A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123131A", "261: AI (8110) position 25: Non-numeric 2nd Purch. Req. 'A'" }, // couponcode - /*290*/ { "[8110]0123456123456101041231310", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231310", "261: AI (8110) position 26: 2nd Purch. Req. Code incomplete" }, // couponcode - /*291*/ { "[8110]0123456123456101041231310A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231310A", "261: AI (8110) position 26: Non-numeric 2nd Purch. Req. Code" }, // couponcode - /*292*/ { "[8110]01234561234561010412313108", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313108", "261: AI (8110) position 26: Invalid 2nd Purch. Req. Code '8'" }, // couponcode - /*293*/ { "[8110]01234561234561010412313100", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100", "261: AI (8110) position 27: 2nd Purch. Family Code incomplete" }, // couponcode - /*294*/ { "[8110]01234561234561010412313100123", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100123", "261: AI (8110) position 30: 2nd Purch. GS1 Co. Prefix VLI missing" }, // couponcode - /*295*/ { "[8110]01234561234561010412313100123A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100123A", "261: AI (8110) position 30: Non-numeric 2nd Purch. GS1 Co. Prefix VLI 'A'" }, // couponcode - /*296*/ { "[8110]012345612345610104123131001239", 0, "8110012345612345610104123131001239", "" }, // couponcode - /*297*/ { "[8110]01234561234561010412313100123012345", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100123012345", "261: AI (8110) position 31: 2nd Purch. GS1 Co. Prefix incomplete" }, // couponcode - /*298*/ { "[8110]0123456123456101041231310012311234567", 0, "81100123456123456101041231310012311234567", "" }, // couponcode - /*299*/ { "[8110]0123456123456101041232", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232", "261: AI (8110) position 23: 3rd Purch. Req. VLI missing" }, // couponcode - /*300*/ { "[8110]0123456123456101041232A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232A", "261: AI (8110) position 23: Non-numeric 3rd Purch. Req. VLI 'A'" }, // couponcode - /*301*/ { "[8110]01234561234561010412326", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412326", "261: AI (8110) position 23: Invalid 3rd Purch. Req. VLI '6'" }, // couponcode - /*302*/ { "[8110]01234561234561010412321", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412321", "261: AI (8110) position 24: 3rd Purch. Req. incomplete" }, // couponcode - /*303*/ { "[8110]012345612345610104123210", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123210", "261: AI (8110) position 25: 3rd Purch. Req. Code incomplete" }, // couponcode - /*304*/ { "[8110]0123456123456101041232105", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232105", "261: AI (8110) position 25: Invalid 3rd Purch. Req. Code '5'" }, // couponcode - /*305*/ { "[8110]0123456123456101041232104", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104", "261: AI (8110) position 26: 3rd Purch. Family Code incomplete" }, // couponcode - /*306*/ { "[8110]012345612345610104123210412A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123210412A", "261: AI (8110) position 26: Non-numeric 3rd Purch. Family Code" }, // couponcode - /*307*/ { "[8110]0123456123456101041232104123", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123", "261: AI (8110) position 29: 3rd Purch. GS1 Co. Prefix VLI missing" }, // couponcode - /*308*/ { "[8110]01234561234561010412321041230", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412321041230", "261: AI (8110) position 30: 3rd Purch. GS1 Co. Prefix incomplete" }, // couponcode - /*309*/ { "[8110]0123456123456101041232104123A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123A", "261: AI (8110) position 29: Non-numeric 3rd Purch. GS1 Co. Prefix VLI 'A'" }, // couponcode - /*310*/ { "[8110]0123456123456101041232104123012345", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123012345", "261: AI (8110) position 30: 3rd Purch. GS1 Co. Prefix incomplete" }, // couponcode - /*311*/ { "[8110]0123456123456101041232104123012345A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123012345A", "261: AI (8110) position 35: Non-numeric 3rd Purch. GS1 Co. Prefix 'A'" }, // couponcode - /*312*/ { "[8110]01234561234561010412321041230123456", 0, "811001234561234561010412321041230123456", "" }, // couponcode - /*313*/ { "[8110]0123456123456101041233", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041233", "261: AI (8110) position 23: Expiration Date incomplete" }, // couponcode - /*314*/ { "[8110]01234561234561010412332012", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412332012", "261: AI (8110) position 23: Expiration Date incomplete" }, // couponcode - /*315*/ { "[8110]012345612345610104123320123A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123320123A", "261: AI (8110) position 23: Non-numeric Expiration Date" }, // couponcode - /*316*/ { "[8110]0123456123456101041233201232", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041233201232", "261: AI (8110) position 27: Invalid day '32'" }, // couponcode - /*317*/ { "[8110]0123456123456101041233200031", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041233200031", "261: AI (8110) position 25: Invalid month '00'" }, // couponcode - /*318*/ { "[8110]0123456123456101041233201231", 0, "81100123456123456101041233201231", "" }, // couponcode - /*319*/ { "[8110]0123456123456101041234", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041234", "261: AI (8110) position 23: Start Date incomplete" }, // couponcode - /*320*/ { "[8110]01234561234561010412342012", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412342012", "261: AI (8110) position 23: Start Date incomplete" }, // couponcode - /*321*/ { "[8110]012345612345610104123420123A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123420123A", "261: AI (8110) position 23: Non-numeric Start Date" }, // couponcode - /*322*/ { "[8110]0123456123456101041234200230", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041234200230", "261: AI (8110) position 27: Invalid day '30'" }, // couponcode - /*323*/ { "[8110]0123456123456101041234201329", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041234201329", "261: AI (8110) position 25: Invalid month '13'" }, // couponcode - /*324*/ { "[8110]0123456123456101041234200229", 0, "81100123456123456101041234200229", "" }, // couponcode - /*325*/ { "[8110]0123456123456101041235", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235", "261: AI (8110) position 23: Serial Number VLI missing" }, // couponcode - /*326*/ { "[8110]0123456123456101041235A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235A", "261: AI (8110) position 23: Non-numeric Serial Number VLI 'A'" }, // couponcode - /*327*/ { "[8110]01234561234561010412350", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412350", "261: AI (8110) position 24: Serial Number incomplete" }, // couponcode - /*328*/ { "[8110]0123456123456101041235012345", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235012345", "261: AI (8110) position 24: Serial Number incomplete" }, // couponcode - /*329*/ { "[8110]0123456123456101041235912345678901234", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235912345678901234", "261: AI (8110) position 24: Serial Number incomplete" }, // couponcode - /*330*/ { "[8110]0123456123456101041235912345678901234A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235912345678901234A", "261: AI (8110) position 38: Non-numeric Serial Number 'A'" }, // couponcode - /*331*/ { "[8110]01234561234561010412359123456789012345", 0, "811001234561234561010412359123456789012345", "" }, // couponcode - /*332*/ { "[8110]0123456123456101041236", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041236", "261: AI (8110) position 23: Retailer ID VLI missing" }, // couponcode - /*333*/ { "[8110]0123456123456101041236A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041236A", "261: AI (8110) position 23: Non-numeric Retailer ID VLI 'A'" }, // couponcode - /*334*/ { "[8110]01234561234561010412360", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412360", "261: AI (8110) position 23: Invalid Retailer ID VLI '0'" }, // couponcode - /*335*/ { "[8110]01234561234561010412368", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412368", "261: AI (8110) position 23: Invalid Retailer ID VLI '8'" }, // couponcode - /*336*/ { "[8110]01234561234561010412361", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412361", "261: AI (8110) position 24: Retailer ID incomplete" }, // couponcode - /*337*/ { "[8110]01234561234561010412361123456", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412361123456", "261: AI (8110) position 24: Retailer ID incomplete" }, // couponcode - /*338*/ { "[8110]01234561234561010412361123456A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412361123456A", "261: AI (8110) position 30: Non-numeric Retailer ID 'A'" }, // couponcode - /*339*/ { "[8110]012345612345610104123671234567890123", 0, "8110012345612345610104123671234567890123", "" }, // couponcode - /*340*/ { "[8110]0123456123456101041239", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239", "261: AI (8110) position 23: Save Value Code incomplete" }, // couponcode - /*341*/ { "[8110]0123456123456101041239A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239A", "261: AI (8110) position 23: Non-numeric Save Value Code" }, // couponcode - /*342*/ { "[8110]01234561234561010412393", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412393", "261: AI (8110) position 23: Invalid Save Value Code '3'" }, // couponcode - /*343*/ { "[8110]01234561234561010412394", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412394", "261: AI (8110) position 23: Invalid Save Value Code '4'" }, // couponcode - /*344*/ { "[8110]01234561234561010412397", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412397", "261: AI (8110) position 23: Invalid Save Value Code '7'" }, // couponcode - /*345*/ { "[8110]01234561234561010412390", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412390", "261: AI (8110) position 24: Save Value Applies To incomplete" }, // couponcode - /*346*/ { "[8110]01234561234561010412390A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412390A", "261: AI (8110) position 24: Non-numeric Save Value Applies To" }, // couponcode - /*347*/ { "[8110]012345612345610104123903", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123903", "261: AI (8110) position 24: Invalid Save Value Applies To '3'" }, // couponcode - /*348*/ { "[8110]012345612345610104123902", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123902", "261: AI (8110) position 25: Store Coupon Flag incomplete" }, // couponcode - /*349*/ { "[8110]012345612345610104123902A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123902A", "261: AI (8110) position 25: Non-numeric Store Coupon Flag" }, // couponcode - /*350*/ { "[8110]0123456123456101041239029", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239029", "261: AI (8110) position 26: Don't Multiply Flag incomplete" }, // couponcode - /*351*/ { "[8110]0123456123456101041239029A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239029A", "261: AI (8110) position 26: Non-numeric Don't Multiply Flag" }, // couponcode - /*352*/ { "[8110]01234561234561010412390292", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412390292", "261: AI (8110) position 26: Invalid Don't Multiply Flag '2'" }, // couponcode - /*353*/ { "[8110]01234561234561010412390291", 0, "811001234561234561010412390291", "" }, // couponcode - /*354*/ { "[8110]177777776666663100120444101105551888888821109991222222232012314200601522345678961345678990000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8110)" }, // couponcode (example from GS1 AI (8112) Coupon Data Specifications Appendix A: AI (8110) vs AI (8112)) - /*355*/ { "[8110]177777776666663100120444101105551888888821109991222222232012314200601", 0, "8110177777776666663100120444101105551888888821109991222222232012314200601", "" }, // couponcode - /*356*/ { "[8112]017777777666666223456789", 0, "8112017777777666666223456789", "" }, // couponposoffer (example from GS1 AI (8112) Coupon Data Specifications Appendix A: AI (8110) vs AI (8112)) - /*357*/ { "[8112]001234561234560123456", 0, "8112001234561234560123456", "" }, // couponposoffer - /*358*/ { "[8112]00123456123456012345", ZINT_WARN_NONCOMPLIANT, "811200123456123456012345", "259: Invalid data length for AI (8112)" }, // couponposoffer - /*359*/ { "[8112]0012345612345601234561", ZINT_WARN_NONCOMPLIANT, "81120012345612345601234561", "261: AI (8112) position 22: Reserved trailing characters" }, // couponposoffer - /*360*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345", "" }, // couponposoffer - /*361*/ { "[8112]0612345678901212345691234567890123456", ZINT_WARN_NONCOMPLIANT, "81120612345678901212345691234567890123456", "259: Invalid data length for AI (8112)" }, // couponposoffer - /*362*/ { "[8112]06123456789012123456912345678901234A", ZINT_WARN_NONCOMPLIANT, "811206123456789012123456912345678901234A", "261: AI (8112) position 36: Non-numeric Serial Number 'A'" }, // couponposoffer - /*363*/ { "[8112]06123456789012123456912345678901234", ZINT_WARN_NONCOMPLIANT, "811206123456789012123456912345678901234", "261: AI (8112) position 22: Serial Number incomplete" }, // couponposoffer - /*364*/ { "[8112]06123456789012123456812345678901234", 0, "811206123456789012123456812345678901234", "" }, // couponposoffer - /*365*/ { "[8112]0612345678901212345681234567890123", ZINT_WARN_NONCOMPLIANT, "81120612345678901212345681234567890123", "261: AI (8112) position 22: Serial Number incomplete" }, // couponposoffer - /*366*/ { "[8112]0612345678901212345A0123456", ZINT_WARN_NONCOMPLIANT, "81120612345678901212345A0123456", "261: AI (8112) position 15: Non-numeric Offer Code" }, // couponposoffer - /*367*/ { "[8112]0612345678901A1234560123456", ZINT_WARN_NONCOMPLIANT, "81120612345678901A1234560123456", "261: AI (8112) position 14: Non-numeric Coupon Funder ID 'A'" }, // couponposoffer - /*368*/ { "[8112]071234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "8112071234567890121234560123456", "261: AI (8112) position 2: Invalid Coupon Funder ID VLI '7'" }, // couponposoffer - /*369*/ { "[8112]0A1234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "81120A1234567890121234560123456", "261: AI (8112) position 2: Non-numeric Coupon Funder ID VLI 'A'" }, // couponposoffer - /*370*/ { "[8112]261234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "8112261234567890121234560123456", "261: AI (8112) position 1: Coupon Format must be 0 or 1" }, // couponposoffer - /*371*/ { "[8112]A61234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "8112A61234567890121234560123456", "261: AI (8112) position 1: Non-numeric Coupon Format" }, // couponposoffer + /*175*/ { "[3910]9251", 0, "39109251", "" }, // iso4217 + /*176*/ { "[3910]01", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910)" }, // iso4217 + /*177*/ { "[3910]001", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910)" }, // iso4217 + /*178*/ { "[3910]9981", ZINT_WARN_NONCOMPLIANT, "39109981", "261: AI (3910) position 1: Unknown currency code '998'" }, // iso4217 + /*179*/ { "[3910]0041", ZINT_WARN_NONCOMPLIANT, "39100041", "261: AI (3910) position 1: Unknown currency code '004'" }, // iso4217 + /*180*/ { "[3910]8941", ZINT_WARN_NONCOMPLIANT, "39108941", "261: AI (3910) position 1: Unknown currency code '894'" }, // iso4217 + /*181*/ { "[4300]%12", 0, "4300%12", "" }, // pcenc + /*182*/ { "[4300]%1", ZINT_WARN_NONCOMPLIANT, "4300%1", "261: AI (4300) position 1: Invalid % escape" }, // pcenc + /*183*/ { "[4300]%", ZINT_WARN_NONCOMPLIANT, "4300%", "261: AI (4300) position 1: Invalid % escape" }, // pcenc + /*184*/ { "[4300]12%1212", 0, "430012%1212", "" }, // pcenc + /*185*/ { "[4300]12%1G12", ZINT_WARN_NONCOMPLIANT, "430012%1G12", "261: AI (4300) position 5: Invalid character for percent encoding" }, // pcenc + /*186*/ { "[4308]ABCDEFGHIJKLMNOPQRSTUVWXYZ%+12", 0, "4308ABCDEFGHIJKLMNOPQRSTUVWXYZ%+12", "" }, // no pcenc + /*187*/ { "[4308]ABCDEFGHIJKLMNOPQRSTUVWXYZ%+123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4308)" }, // no pcenc + /*188*/ { "[4309]02790858483015297971", 0, "430902790858483015297971", "" }, // latlong + /*189*/ { "[4309]18000000013015297971", ZINT_WARN_NONCOMPLIANT, "430918000000013015297971", "261: AI (4309) position 10: Invalid latitude" }, // latlong + /*190*/ { "[4309]02790858418000000001", ZINT_WARN_NONCOMPLIANT, "430902790858418000000001", "261: AI (4309) position 20: Invalid longitude" }, // latlong + /*191*/ { "[4321]1", 0, "43211", "" }, // yesno + /*192*/ { "[4321]0", 0, "43210", "" }, // yesno + /*193*/ { "[4321]2", ZINT_WARN_NONCOMPLIANT, "43212", "261: AI (4321) position 1: Neither 0 nor 1 for yes or no" }, // yesno + /*194*/ { "[4321]9", ZINT_WARN_NONCOMPLIANT, "43219", "261: AI (4321) position 1: Neither 0 nor 1 for yes or no" }, // yesno + /*195*/ { "[7040]1234", 0, "70401234", "" }, // importeridx + /*196*/ { "[7040]123A", 0, "7040123A", "" }, // importeridx + /*197*/ { "[7040]123Z", 0, "7040123Z", "" }, // importeridx + /*198*/ { "[7040]123a", 0, "7040123a", "" }, // importeridx + /*199*/ { "[7040]123z", 0, "7040123z", "" }, // importeridx + /*200*/ { "[7040]123-", 0, "7040123-", "" }, // importeridx + /*201*/ { "[7040]123_", 0, "7040123_", "" }, // importeridx + /*202*/ { "[7040]123!", ZINT_WARN_NONCOMPLIANT, "7040123!", "261: AI (7040) position 4: Invalid importer index '!'" }, // importeridx + /*203*/ { "[7040]123/", ZINT_WARN_NONCOMPLIANT, "7040123/", "261: AI (7040) position 4: Invalid importer index '/'" }, // importeridx + /*204*/ { "[7040]123:", ZINT_WARN_NONCOMPLIANT, "7040123:", "261: AI (7040) position 4: Invalid importer index ':'" }, // importeridx + /*205*/ { "[7040]123?", ZINT_WARN_NONCOMPLIANT, "7040123?", "261: AI (7040) position 4: Invalid importer index '?'" }, // importeridx + /*206*/ { "[8001]12341234512311", 0, "800112341234512311", "" }, // nonzero + /*207*/ { "[8001]00010000100100", 0, "800100010000100100", "" }, // nonzero + /*208*/ { "[8001]00001234512311", ZINT_WARN_NONCOMPLIANT, "800100001234512311", "261: AI (8001) position 1: Zero not permitted" }, // nonzero + /*209*/ { "[8001]12340000012311", ZINT_WARN_NONCOMPLIANT, "800112340000012311", "261: AI (8001) position 5: Zero not permitted" }, // nonzero + /*210*/ { "[8001]00010000100011", ZINT_WARN_NONCOMPLIANT, "800100010000100011", "261: AI (8001) position 10: Zero not permitted" }, // nonzero + /*211*/ { "[8001]00010000100101", 0, "800100010000100101", "" }, // winding + /*212*/ { "[8001]00010000100111", 0, "800100010000100111", "" }, // winding + /*213*/ { "[8001]00010000100191", 0, "800100010000100191", "" }, // winding + /*214*/ { "[8001]00010000100121", ZINT_WARN_NONCOMPLIANT, "800100010000100121", "261: AI (8001) position 13: Invalid winding direction '2'" }, // winding + /*215*/ { "[8001]00010000100131", ZINT_WARN_NONCOMPLIANT, "800100010000100131", "261: AI (8001) position 13: Invalid winding direction '3'" }, // winding + /*216*/ { "[8001]00010000100171", ZINT_WARN_NONCOMPLIANT, "800100010000100171", "261: AI (8001) position 13: Invalid winding direction '7'" }, // winding + /*217*/ { "[8001]00010000100181", ZINT_WARN_NONCOMPLIANT, "800100010000100181", "261: AI (8001) position 13: Invalid winding direction '8'" }, // winding + /*218*/ { "[8003]01234567890128", 0, "800301234567890128", "" }, // zero + /*219*/ { "[8003]11234567890128", ZINT_WARN_NONCOMPLIANT, "800311234567890128", "261: AI (8003) position 1: Zero is required" }, // zero + /*220*/ { "[8003]91234567890128", ZINT_WARN_NONCOMPLIANT, "800391234567890128", "261: AI (8003) position 1: Zero is required" }, // zero + /*221*/ { "[8006]123456789012310101", 0, "8006123456789012310101", "" }, // pieceoftotal + /*222*/ { "[8006]123456789012310199", 0, "8006123456789012310199", "" }, // pieceoftotal + /*223*/ { "[8006]123456789012319999", 0, "8006123456789012319999", "" }, // pieceoftotal + /*224*/ { "[8006]123456789012310001", ZINT_WARN_NONCOMPLIANT, "8006123456789012310001", "261: AI (8006) position 15: Piece number cannot be zero" }, // pieceoftotal + /*225*/ { "[8006]123456789012310100", ZINT_WARN_NONCOMPLIANT, "8006123456789012310100", "261: AI (8006) position 15: Total number cannot be zero" }, // pieceoftotal + /*226*/ { "[8006]123456789012310201", ZINT_WARN_NONCOMPLIANT, "8006123456789012310201", "261: AI (8006) position 15: Piece number '02' exceeds total '01'" }, // pieceoftotal + /*227*/ { "[8006]123456789012319998", ZINT_WARN_NONCOMPLIANT, "8006123456789012319998", "261: AI (8006) position 15: Piece number '99' exceeds total '98'" }, // pieceoftotal + /*228*/ { "[8007]GB82WEST12345698765432", 0, "8007GB82WEST12345698765432", "" }, // iban + /*229*/ { "[8007]GB83WEST12345698765432", ZINT_WARN_NONCOMPLIANT, "8007GB83WEST12345698765432", "261: AI (8007) position 3: Bad IBAN checksum '83', expected '82'" }, // iban + /*230*/ { "[8007]BE71096123456769", 0, "8007BE71096123456769", "" }, // iban + /*231*/ { "[8007]BE71096123456760", ZINT_WARN_NONCOMPLIANT, "8007BE71096123456760", "261: AI (8007) position 3: Bad IBAN checksum '71', expected '23'" }, // iban + /*232*/ { "[8007]BE01096123456760", ZINT_WARN_NONCOMPLIANT, "8007BE01096123456760", "261: AI (8007) position 3: Bad IBAN checksum '01', expected '23'" }, // iban + /*233*/ { "[8007]BE00096123456760", ZINT_WARN_NONCOMPLIANT, "8007BE00096123456760", "261: AI (8007) position 3: Bad IBAN checksum '00', expected '23'" }, // iban + /*234*/ { "[8007]LC14BOSL123456789012345678901234", 0, "8007LC14BOSL123456789012345678901234", "" }, // iban + /*235*/ { "[8007]LC14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007LC14BOSL123456789012345678901230", "261: AI (8007) position 3: Bad IBAN checksum '14', expected '25'" }, // iban + /*236*/ { "[8007]A114BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007A114BOSL123456789012345678901230", "261: AI (8007) position 1: Non-alphabetic IBAN country code 'A1'" }, // iban + /*237*/ { "[8007]1A14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "80071A14BOSL123456789012345678901230", "261: AI (8007) position 1: Non-alphabetic IBAN country code '1A'" }, // iban + /*238*/ { "[8007]AA14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007AA14BOSL123456789012345678901230", "261: AI (8007) position 1: Invalid IBAN country code 'AA'" }, // iban + /*239*/ { "[8007]ZZ14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZZ14BOSL123456789012345678901230", "261: AI (8007) position 1: Invalid IBAN country code 'ZZ'" }, // iban + /*240*/ { "[8007]ZW33BOSL123456789012345678901230", 0, "8007ZW33BOSL123456789012345678901230", "" }, // iban + /*241*/ { "[8007]ZWA3BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZWA3BOSL123456789012345678901230", "261: AI (8007) position 3: Non-numeric IBAN checksum 'A3'" }, // iban + /*242*/ { "[8007]ZW3ABOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZW3ABOSL123456789012345678901230", "261: AI (8007) position 3: Non-numeric IBAN checksum '3A'" }, // iban + /*243*/ { "[8007]ZW33bOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZW33bOSL123456789012345678901230", "261: AI (8007) position 5: Invalid IBAN character 'b'" }, // iban + /*244*/ { "[8007]GB98", ZINT_WARN_NONCOMPLIANT, "8007GB98", "259: Invalid data length for AI (8007)" }, // iban + /*245*/ { "[8007]FR7630006000011234567890189", 0, "8007FR7630006000011234567890189", "" }, // iban + /*246*/ { "[8007]DE91100000000123456789", 0, "8007DE91100000000123456789", "" }, // iban + /*247*/ { "[8007]GR9608100010000001234567890", 0, "8007GR9608100010000001234567890", "" }, // iban + /*248*/ { "[8007]MU43BOMM0101123456789101000MUR", 0, "8007MU43BOMM0101123456789101000MUR", "" }, // iban + /*249*/ { "[8007]PL10105000997603123456789123", 0, "8007PL10105000997603123456789123", "" }, // iban + /*250*/ { "[8007]RO09BCYP0000001234567890", 0, "8007RO09BCYP0000001234567890", "" }, // iban + /*251*/ { "[8007]SA4420000001234567891234", 0, "8007SA4420000001234567891234", "" }, // iban + /*252*/ { "[8007]ES7921000813610123456789", 0, "8007ES7921000813610123456789", "" }, // iban + /*253*/ { "[8007]CH5604835012345678009", 0, "8007CH5604835012345678009", "" }, // iban + /*254*/ { "[8007]GB98MIDL07009312345678", 0, "8007GB98MIDL07009312345678", "" }, // iban + /*255*/ { "[8011]1", 0, "80111", "" }, // nozeroprefix + /*256*/ { "[8011]11", 0, "801111", "" }, // nozeroprefix + /*257*/ { "[8011]0", 0, "80110", "" }, // nozeroprefix + /*258*/ { "[8011]01", ZINT_WARN_NONCOMPLIANT, "801101", "261: AI (8011) position 1: Zero prefix is not permitted" }, // nozeroprefix + /*259*/ { "[8110]106141416543213150110120", 0, "8110106141416543213150110120", "" }, // couponcode (first part of NACAG Appendix C: Example 1 - see test_rss.c test_examples) + /*260*/ { "[8110]012345612345610104123", 0, "8110012345612345610104123", "" }, // couponcode + /*261*/ { "[8110]01234561234561010412", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412", "259: Invalid data length for AI (8110)" }, // couponcode + /*262*/ { "[8110]12345678901234567890", ZINT_WARN_NONCOMPLIANT, "811012345678901234567890", "259: Invalid data length for AI (8110)" }, // couponcode + /*263*/ { "[8110]712345612345610104123", ZINT_WARN_NONCOMPLIANT, "8110712345612345610104123", "261: AI (8110) position 1: Invalid Primary GS1 Co. Prefix VLI '7'" }, // couponcode + /*264*/ { "[8110]A12345612345610104123", ZINT_WARN_NONCOMPLIANT, "8110A12345612345610104123", "261: AI (8110) position 1: Non-numeric Primary GS1 Co. Prefix VLI 'A'" }, // couponcode + /*265*/ { "[8110]012345A12345610104123", ZINT_WARN_NONCOMPLIANT, "8110012345A12345610104123", "261: AI (8110) position 7: Non-numeric Primary GS1 Co. Prefix 'A'" }, // couponcode + /*266*/ { "[8110]012345612345A10104123", ZINT_WARN_NONCOMPLIANT, "8110012345612345A10104123", "261: AI (8110) position 8: Non-numeric Offer Code" }, // couponcode + /*267*/ { "[8110]012345612345600104123", ZINT_WARN_NONCOMPLIANT, "8110012345612345600104123", "261: AI (8110) position 14: Invalid Save Value VLI '0'" }, // couponcode + /*268*/ { "[8110]012345612345660104123", ZINT_WARN_NONCOMPLIANT, "8110012345612345660104123", "261: AI (8110) position 14: Invalid Save Value VLI '6'" }, // couponcode + /*269*/ { "[8110]01234561234561A104123", ZINT_WARN_NONCOMPLIANT, "811001234561234561A104123", "261: AI (8110) position 15: Non-numeric Save Value 'A'" }, // couponcode + /*270*/ { "[8110]012345612345610004123", ZINT_WARN_NONCOMPLIANT, "8110012345612345610004123", "261: AI (8110) position 16: Invalid Primary Purch. Req. VLI '0'" }, // couponcode + /*271*/ { "[8110]012345612345610604123", ZINT_WARN_NONCOMPLIANT, "8110012345612345610604123", "261: AI (8110) position 16: Invalid Primary Purch. Req. VLI '6'" }, // couponcode + /*272*/ { "[8110]0123456123456101A4123", ZINT_WARN_NONCOMPLIANT, "81100123456123456101A4123", "261: AI (8110) position 17: Non-numeric Primary Purch. Req. 'A'" }, // couponcode + /*273*/ { "[8110]012345612345621251234", ZINT_WARN_NONCOMPLIANT, "8110012345612345621251234", "261: AI (8110) position 18: Primary Purch. Req. incomplete" }, // couponcode + /*274*/ { "[8110]01234561234561010A123", ZINT_WARN_NONCOMPLIANT, "811001234561234561010A123", "261: AI (8110) position 18: Non-numeric Primary Purch. Req. Code" }, // couponcode + /*275*/ { "[8110]012345612345610106123", ZINT_WARN_NONCOMPLIANT, "8110012345612345610106123", "261: AI (8110) position 18: Invalid Primary Purch. Req. Code '6'" }, // couponcode + /*276*/ { "[8110]012345612345610212412", ZINT_WARN_NONCOMPLIANT, "8110012345612345610212412", "261: AI (8110) position 20: Primary Purch. Family Code incomplete" }, // couponcode + /*277*/ { "[8110]0123456123456103123412", ZINT_WARN_NONCOMPLIANT, "81100123456123456103123412", "261: AI (8110) position 21: Primary Purch. Family Code incomplete" }, // couponcode + /*278*/ { "[8110]0123456123456103123412A", ZINT_WARN_NONCOMPLIANT, "81100123456123456103123412A", "261: AI (8110) position 21: Non-numeric Primary Purch. Family Code" }, // couponcode + /*279*/ { "[8110]01234561234561031234123", 0, "811001234561234561031234123", "" }, // couponcode + /*280*/ { "[8110]612345678901212345651", ZINT_WARN_NONCOMPLIANT, "8110612345678901212345651", "261: AI (8110) position 21: Save Value incomplete" }, // couponcode + /*281*/ { "[8110]6123456789012123456512345", ZINT_WARN_NONCOMPLIANT, "81106123456789012123456512345", "261: AI (8110) position 26: Primary Purch. Req. VLI missing" }, // couponcode + /*282*/ { "[8110]61234567890121234565123455123454123", 0, "811061234567890121234565123455123454123", "" }, // couponcode + /*283*/ { "[8110]61234567890121234565123455123454123A", ZINT_WARN_NONCOMPLIANT, "811061234567890121234565123455123454123A", "261: AI (8110) position 36: Non-numeric Data Field 'A'" }, // couponcode + /*284*/ { "[8110]612345678901212345651234551234541237", ZINT_WARN_NONCOMPLIANT, "8110612345678901212345651234551234541237", "261: AI (8110) position 36: Invalid Data Field '7'" }, // couponcode + /*285*/ { "[8110]612345678901212345651234551234541238", ZINT_WARN_NONCOMPLIANT, "8110612345678901212345651234551234541238", "261: AI (8110) position 36: Invalid Data Field '8'" }, // couponcode + /*286*/ { "[8110]0123456123456101041231", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231", "261: AI (8110) position 23: Add. Purch. Rules Code incomplete" }, // couponcode + /*287*/ { "[8110]0123456123456101041231A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231A", "261: AI (8110) position 23: Non-numeric Add. Purch. Rules Code" }, // couponcode + /*288*/ { "[8110]01234561234561010412314", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412314", "261: AI (8110) position 23: Invalid Add. Purch. Rules Code '4'" }, // couponcode + /*289*/ { "[8110]01234561234561010412313", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313", "261: AI (8110) position 24: 2nd Purch. Req. VLI missing" }, // couponcode + /*290*/ { "[8110]01234561234561010412313A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313A", "261: AI (8110) position 24: Non-numeric 2nd Purch. Req. VLI 'A'" }, // couponcode + /*291*/ { "[8110]012345612345610104123130", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123130", "261: AI (8110) position 24: Invalid 2nd Purch. Req. VLI '0'" }, // couponcode + /*292*/ { "[8110]012345612345610104123131", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123131", "261: AI (8110) position 25: 2nd Purch. Req. incomplete" }, // couponcode + /*293*/ { "[8110]012345612345610104123131A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123131A", "261: AI (8110) position 25: Non-numeric 2nd Purch. Req. 'A'" }, // couponcode + /*294*/ { "[8110]0123456123456101041231310", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231310", "261: AI (8110) position 26: 2nd Purch. Req. Code incomplete" }, // couponcode + /*295*/ { "[8110]0123456123456101041231310A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231310A", "261: AI (8110) position 26: Non-numeric 2nd Purch. Req. Code" }, // couponcode + /*296*/ { "[8110]01234561234561010412313108", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313108", "261: AI (8110) position 26: Invalid 2nd Purch. Req. Code '8'" }, // couponcode + /*297*/ { "[8110]01234561234561010412313100", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100", "261: AI (8110) position 27: 2nd Purch. Family Code incomplete" }, // couponcode + /*298*/ { "[8110]01234561234561010412313100123", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100123", "261: AI (8110) position 30: 2nd Purch. GS1 Co. Prefix VLI missing" }, // couponcode + /*299*/ { "[8110]01234561234561010412313100123A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100123A", "261: AI (8110) position 30: Non-numeric 2nd Purch. GS1 Co. Prefix VLI 'A'" }, // couponcode + /*300*/ { "[8110]012345612345610104123131001239", 0, "8110012345612345610104123131001239", "" }, // couponcode + /*301*/ { "[8110]01234561234561010412313100123012345", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100123012345", "261: AI (8110) position 31: 2nd Purch. GS1 Co. Prefix incomplete" }, // couponcode + /*302*/ { "[8110]0123456123456101041231310012311234567", 0, "81100123456123456101041231310012311234567", "" }, // couponcode + /*303*/ { "[8110]0123456123456101041232", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232", "261: AI (8110) position 23: 3rd Purch. Req. VLI missing" }, // couponcode + /*304*/ { "[8110]0123456123456101041232A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232A", "261: AI (8110) position 23: Non-numeric 3rd Purch. Req. VLI 'A'" }, // couponcode + /*305*/ { "[8110]01234561234561010412326", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412326", "261: AI (8110) position 23: Invalid 3rd Purch. Req. VLI '6'" }, // couponcode + /*306*/ { "[8110]01234561234561010412321", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412321", "261: AI (8110) position 24: 3rd Purch. Req. incomplete" }, // couponcode + /*307*/ { "[8110]012345612345610104123210", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123210", "261: AI (8110) position 25: 3rd Purch. Req. Code incomplete" }, // couponcode + /*308*/ { "[8110]0123456123456101041232105", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232105", "261: AI (8110) position 25: Invalid 3rd Purch. Req. Code '5'" }, // couponcode + /*309*/ { "[8110]0123456123456101041232104", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104", "261: AI (8110) position 26: 3rd Purch. Family Code incomplete" }, // couponcode + /*310*/ { "[8110]012345612345610104123210412A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123210412A", "261: AI (8110) position 26: Non-numeric 3rd Purch. Family Code" }, // couponcode + /*311*/ { "[8110]0123456123456101041232104123", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123", "261: AI (8110) position 29: 3rd Purch. GS1 Co. Prefix VLI missing" }, // couponcode + /*312*/ { "[8110]01234561234561010412321041230", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412321041230", "261: AI (8110) position 30: 3rd Purch. GS1 Co. Prefix incomplete" }, // couponcode + /*313*/ { "[8110]0123456123456101041232104123A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123A", "261: AI (8110) position 29: Non-numeric 3rd Purch. GS1 Co. Prefix VLI 'A'" }, // couponcode + /*314*/ { "[8110]0123456123456101041232104123012345", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123012345", "261: AI (8110) position 30: 3rd Purch. GS1 Co. Prefix incomplete" }, // couponcode + /*315*/ { "[8110]0123456123456101041232104123012345A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123012345A", "261: AI (8110) position 35: Non-numeric 3rd Purch. GS1 Co. Prefix 'A'" }, // couponcode + /*316*/ { "[8110]01234561234561010412321041230123456", 0, "811001234561234561010412321041230123456", "" }, // couponcode + /*317*/ { "[8110]0123456123456101041233", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041233", "261: AI (8110) position 23: Expiration Date incomplete" }, // couponcode + /*318*/ { "[8110]01234561234561010412332012", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412332012", "261: AI (8110) position 23: Expiration Date incomplete" }, // couponcode + /*319*/ { "[8110]012345612345610104123320123A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123320123A", "261: AI (8110) position 23: Non-numeric Expiration Date" }, // couponcode + /*320*/ { "[8110]0123456123456101041233201232", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041233201232", "261: AI (8110) position 27: Invalid day '32'" }, // couponcode + /*321*/ { "[8110]0123456123456101041233200031", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041233200031", "261: AI (8110) position 25: Invalid month '00'" }, // couponcode + /*322*/ { "[8110]0123456123456101041233201231", 0, "81100123456123456101041233201231", "" }, // couponcode + /*323*/ { "[8110]0123456123456101041234", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041234", "261: AI (8110) position 23: Start Date incomplete" }, // couponcode + /*324*/ { "[8110]01234561234561010412342012", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412342012", "261: AI (8110) position 23: Start Date incomplete" }, // couponcode + /*325*/ { "[8110]012345612345610104123420123A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123420123A", "261: AI (8110) position 23: Non-numeric Start Date" }, // couponcode + /*326*/ { "[8110]0123456123456101041234200230", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041234200230", "261: AI (8110) position 27: Invalid day '30'" }, // couponcode + /*327*/ { "[8110]0123456123456101041234201329", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041234201329", "261: AI (8110) position 25: Invalid month '13'" }, // couponcode + /*328*/ { "[8110]0123456123456101041234200229", 0, "81100123456123456101041234200229", "" }, // couponcode + /*329*/ { "[8110]0123456123456101041235", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235", "261: AI (8110) position 23: Serial Number VLI missing" }, // couponcode + /*330*/ { "[8110]0123456123456101041235A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235A", "261: AI (8110) position 23: Non-numeric Serial Number VLI 'A'" }, // couponcode + /*331*/ { "[8110]01234561234561010412350", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412350", "261: AI (8110) position 24: Serial Number incomplete" }, // couponcode + /*332*/ { "[8110]0123456123456101041235012345", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235012345", "261: AI (8110) position 24: Serial Number incomplete" }, // couponcode + /*333*/ { "[8110]0123456123456101041235912345678901234", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235912345678901234", "261: AI (8110) position 24: Serial Number incomplete" }, // couponcode + /*334*/ { "[8110]0123456123456101041235912345678901234A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235912345678901234A", "261: AI (8110) position 38: Non-numeric Serial Number 'A'" }, // couponcode + /*335*/ { "[8110]01234561234561010412359123456789012345", 0, "811001234561234561010412359123456789012345", "" }, // couponcode + /*336*/ { "[8110]0123456123456101041236", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041236", "261: AI (8110) position 23: Retailer ID VLI missing" }, // couponcode + /*337*/ { "[8110]0123456123456101041236A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041236A", "261: AI (8110) position 23: Non-numeric Retailer ID VLI 'A'" }, // couponcode + /*338*/ { "[8110]01234561234561010412360", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412360", "261: AI (8110) position 23: Invalid Retailer ID VLI '0'" }, // couponcode + /*339*/ { "[8110]01234561234561010412368", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412368", "261: AI (8110) position 23: Invalid Retailer ID VLI '8'" }, // couponcode + /*340*/ { "[8110]01234561234561010412361", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412361", "261: AI (8110) position 24: Retailer ID incomplete" }, // couponcode + /*341*/ { "[8110]01234561234561010412361123456", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412361123456", "261: AI (8110) position 24: Retailer ID incomplete" }, // couponcode + /*342*/ { "[8110]01234561234561010412361123456A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412361123456A", "261: AI (8110) position 30: Non-numeric Retailer ID 'A'" }, // couponcode + /*343*/ { "[8110]012345612345610104123671234567890123", 0, "8110012345612345610104123671234567890123", "" }, // couponcode + /*344*/ { "[8110]0123456123456101041239", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239", "261: AI (8110) position 23: Save Value Code incomplete" }, // couponcode + /*345*/ { "[8110]0123456123456101041239A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239A", "261: AI (8110) position 23: Non-numeric Save Value Code" }, // couponcode + /*346*/ { "[8110]01234561234561010412393", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412393", "261: AI (8110) position 23: Invalid Save Value Code '3'" }, // couponcode + /*347*/ { "[8110]01234561234561010412394", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412394", "261: AI (8110) position 23: Invalid Save Value Code '4'" }, // couponcode + /*348*/ { "[8110]01234561234561010412397", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412397", "261: AI (8110) position 23: Invalid Save Value Code '7'" }, // couponcode + /*349*/ { "[8110]01234561234561010412390", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412390", "261: AI (8110) position 24: Save Value Applies To incomplete" }, // couponcode + /*350*/ { "[8110]01234561234561010412390A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412390A", "261: AI (8110) position 24: Non-numeric Save Value Applies To" }, // couponcode + /*351*/ { "[8110]012345612345610104123903", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123903", "261: AI (8110) position 24: Invalid Save Value Applies To '3'" }, // couponcode + /*352*/ { "[8110]012345612345610104123902", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123902", "261: AI (8110) position 25: Store Coupon Flag incomplete" }, // couponcode + /*353*/ { "[8110]012345612345610104123902A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123902A", "261: AI (8110) position 25: Non-numeric Store Coupon Flag" }, // couponcode + /*354*/ { "[8110]0123456123456101041239029", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239029", "261: AI (8110) position 26: Don't Multiply Flag incomplete" }, // couponcode + /*355*/ { "[8110]0123456123456101041239029A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239029A", "261: AI (8110) position 26: Non-numeric Don't Multiply Flag" }, // couponcode + /*356*/ { "[8110]01234561234561010412390292", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412390292", "261: AI (8110) position 26: Invalid Don't Multiply Flag '2'" }, // couponcode + /*357*/ { "[8110]01234561234561010412390291", 0, "811001234561234561010412390291", "" }, // couponcode + /*358*/ { "[8110]177777776666663100120444101105551888888821109991222222232012314200601522345678961345678990000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8110)" }, // couponcode (example from GS1 AI (8112) Coupon Data Specifications Appendix A: AI (8110) vs AI (8112)) + /*359*/ { "[8110]177777776666663100120444101105551888888821109991222222232012314200601", 0, "8110177777776666663100120444101105551888888821109991222222232012314200601", "" }, // couponcode + /*360*/ { "[8112]017777777666666223456789", 0, "8112017777777666666223456789", "" }, // couponposoffer (example from GS1 AI (8112) Coupon Data Specifications Appendix A: AI (8110) vs AI (8112)) + /*361*/ { "[8112]001234561234560123456", 0, "8112001234561234560123456", "" }, // couponposoffer + /*362*/ { "[8112]00123456123456012345", ZINT_WARN_NONCOMPLIANT, "811200123456123456012345", "259: Invalid data length for AI (8112)" }, // couponposoffer + /*363*/ { "[8112]0012345612345601234561", ZINT_WARN_NONCOMPLIANT, "81120012345612345601234561", "261: AI (8112) position 22: Reserved trailing characters" }, // couponposoffer + /*364*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345", "" }, // couponposoffer + /*365*/ { "[8112]0612345678901212345691234567890123456", ZINT_WARN_NONCOMPLIANT, "81120612345678901212345691234567890123456", "259: Invalid data length for AI (8112)" }, // couponposoffer + /*366*/ { "[8112]06123456789012123456912345678901234A", ZINT_WARN_NONCOMPLIANT, "811206123456789012123456912345678901234A", "261: AI (8112) position 36: Non-numeric Serial Number 'A'" }, // couponposoffer + /*367*/ { "[8112]06123456789012123456912345678901234", ZINT_WARN_NONCOMPLIANT, "811206123456789012123456912345678901234", "261: AI (8112) position 22: Serial Number incomplete" }, // couponposoffer + /*368*/ { "[8112]06123456789012123456812345678901234", 0, "811206123456789012123456812345678901234", "" }, // couponposoffer + /*369*/ { "[8112]0612345678901212345681234567890123", ZINT_WARN_NONCOMPLIANT, "81120612345678901212345681234567890123", "261: AI (8112) position 22: Serial Number incomplete" }, // couponposoffer + /*370*/ { "[8112]0612345678901212345A0123456", ZINT_WARN_NONCOMPLIANT, "81120612345678901212345A0123456", "261: AI (8112) position 15: Non-numeric Offer Code" }, // couponposoffer + /*371*/ { "[8112]0612345678901A1234560123456", ZINT_WARN_NONCOMPLIANT, "81120612345678901A1234560123456", "261: AI (8112) position 14: Non-numeric Coupon Funder ID 'A'" }, // couponposoffer + /*372*/ { "[8112]071234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "8112071234567890121234560123456", "261: AI (8112) position 2: Invalid Coupon Funder ID VLI '7'" }, // couponposoffer + /*373*/ { "[8112]0A1234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "81120A1234567890121234560123456", "261: AI (8112) position 2: Non-numeric Coupon Funder ID VLI 'A'" }, // couponposoffer + /*374*/ { "[8112]261234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "8112261234567890121234560123456", "261: AI (8112) position 1: Coupon Format must be 0 or 1" }, // couponposoffer + /*375*/ { "[8112]A61234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "8112A61234567890121234560123456", "261: AI (8112) position 1: Non-numeric Coupon Format" }, // couponposoffer }; int data_size = ARRAY_SIZE(data); int i, length, ret; diff --git a/backend/tests/test_iso4217.c b/backend/tests/test_iso4217.c index f5f7a27c..55c7447f 100644 --- a/backend/tests/test_iso4217.c +++ b/backend/tests/test_iso4217.c @@ -1,6 +1,6 @@ /* libzint - the open source barcode library - Copyright (C) 2021 Robin Stuart + Copyright (C) 2021-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -27,7 +27,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* vim: set ts=4 sw=4 et : */ +/* SPDX-License-Identifier: BSD-3-Clause */ #include "testcommon.h" #include "../iso4217.h" @@ -38,7 +38,7 @@ static void test_numeric(int index) { int data; int ret; }; - // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) + /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { /* 0*/ { -1, 0 }, /* 1*/ { 0, 0 }, @@ -350,82 +350,84 @@ static void test_numeric(int index) { /*307*/ { 900, 0 }, /*308*/ { 901, 1 }, /*309*/ { 902, 0 }, - /*310*/ { 926, 0 }, - /*311*/ { 927, 1 }, - /*312*/ { 928, 1 }, - /*313*/ { 929, 1 }, - /*314*/ { 930, 1 }, - /*315*/ { 931, 1 }, - /*316*/ { 932, 1 }, - /*317*/ { 933, 1 }, - /*318*/ { 934, 1 }, - /*319*/ { 935, 0 }, - /*320*/ { 936, 1 }, - /*321*/ { 937, 0 }, - /*322*/ { 938, 1 }, - /*323*/ { 939, 0 }, - /*324*/ { 940, 1 }, - /*325*/ { 941, 1 }, - /*326*/ { 942, 0 }, - /*327*/ { 943, 1 }, - /*328*/ { 944, 1 }, - /*329*/ { 945, 0 }, - /*330*/ { 946, 1 }, - /*331*/ { 947, 1 }, - /*332*/ { 948, 1 }, - /*333*/ { 949, 1 }, - /*334*/ { 950, 1 }, - /*335*/ { 951, 1 }, - /*336*/ { 952, 1 }, - /*337*/ { 953, 1 }, - /*338*/ { 954, 0 }, - /*339*/ { 955, 1 }, - /*340*/ { 956, 1 }, - /*341*/ { 957, 1 }, - /*342*/ { 958, 1 }, - /*343*/ { 959, 1 }, - /*344*/ { 960, 1 }, - /*345*/ { 961, 1 }, - /*346*/ { 962, 1 }, - /*347*/ { 963, 1 }, - /*348*/ { 964, 1 }, - /*349*/ { 965, 1 }, - /*350*/ { 966, 0 }, - /*351*/ { 967, 1 }, - /*352*/ { 968, 1 }, - /*353*/ { 969, 1 }, - /*354*/ { 970, 1 }, - /*355*/ { 971, 1 }, - /*356*/ { 972, 1 }, - /*357*/ { 973, 1 }, - /*358*/ { 974, 0 }, - /*359*/ { 975, 1 }, - /*360*/ { 976, 1 }, - /*361*/ { 977, 1 }, - /*362*/ { 978, 1 }, - /*363*/ { 979, 1 }, - /*364*/ { 980, 1 }, - /*365*/ { 981, 1 }, - /*366*/ { 982, 0 }, - /*367*/ { 983, 0 }, - /*368*/ { 984, 1 }, - /*369*/ { 985, 1 }, - /*370*/ { 986, 1 }, - /*371*/ { 987, 0 }, - /*372*/ { 988, 0 }, - /*373*/ { 989, 0 }, - /*374*/ { 990, 1 }, - /*375*/ { 991, 0 }, - /*376*/ { 992, 0 }, - /*377*/ { 993, 0 }, - /*378*/ { 994, 1 }, - /*379*/ { 995, 0 }, - /*380*/ { 996, 0 }, - /*381*/ { 997, 1 }, - /*382*/ { 998, 0 }, - /*383*/ { 999, 1 }, - /*384*/ { 1000, 0 }, - /*385*/ { 2000, 0 }, + /*310*/ { 924, 0 }, + /*311*/ { 925, 1 }, + /*312*/ { 926, 0 }, + /*313*/ { 927, 1 }, + /*314*/ { 928, 1 }, + /*315*/ { 929, 1 }, + /*316*/ { 930, 1 }, + /*317*/ { 931, 1 }, + /*318*/ { 932, 1 }, + /*319*/ { 933, 1 }, + /*320*/ { 934, 1 }, + /*321*/ { 935, 0 }, + /*322*/ { 936, 1 }, + /*323*/ { 937, 0 }, + /*324*/ { 938, 1 }, + /*325*/ { 939, 0 }, + /*326*/ { 940, 1 }, + /*327*/ { 941, 1 }, + /*328*/ { 942, 0 }, + /*329*/ { 943, 1 }, + /*330*/ { 944, 1 }, + /*331*/ { 945, 0 }, + /*332*/ { 946, 1 }, + /*333*/ { 947, 1 }, + /*334*/ { 948, 1 }, + /*335*/ { 949, 1 }, + /*336*/ { 950, 1 }, + /*337*/ { 951, 1 }, + /*338*/ { 952, 1 }, + /*339*/ { 953, 1 }, + /*340*/ { 954, 0 }, + /*341*/ { 955, 1 }, + /*342*/ { 956, 1 }, + /*343*/ { 957, 1 }, + /*344*/ { 958, 1 }, + /*345*/ { 959, 1 }, + /*346*/ { 960, 1 }, + /*347*/ { 961, 1 }, + /*348*/ { 962, 1 }, + /*349*/ { 963, 1 }, + /*350*/ { 964, 1 }, + /*351*/ { 965, 1 }, + /*352*/ { 966, 0 }, + /*353*/ { 967, 1 }, + /*354*/ { 968, 1 }, + /*355*/ { 969, 1 }, + /*356*/ { 970, 1 }, + /*357*/ { 971, 1 }, + /*358*/ { 972, 1 }, + /*359*/ { 973, 1 }, + /*360*/ { 974, 0 }, + /*361*/ { 975, 1 }, + /*362*/ { 976, 1 }, + /*363*/ { 977, 1 }, + /*364*/ { 978, 1 }, + /*365*/ { 979, 1 }, + /*366*/ { 980, 1 }, + /*367*/ { 981, 1 }, + /*368*/ { 982, 0 }, + /*369*/ { 983, 0 }, + /*370*/ { 984, 1 }, + /*371*/ { 985, 1 }, + /*372*/ { 986, 1 }, + /*373*/ { 987, 0 }, + /*374*/ { 988, 0 }, + /*375*/ { 989, 0 }, + /*376*/ { 990, 1 }, + /*377*/ { 991, 0 }, + /*378*/ { 992, 0 }, + /*379*/ { 993, 0 }, + /*380*/ { 994, 1 }, + /*381*/ { 995, 0 }, + /*382*/ { 996, 0 }, + /*383*/ { 997, 1 }, + /*384*/ { 998, 0 }, + /*385*/ { 999, 1 }, + /*386*/ { 1000, 0 }, + /*387*/ { 2000, 0 }, }; int data_size = ARRAY_SIZE(data); int i, ret; @@ -445,7 +447,7 @@ static void test_numeric(int index) { /* Binary chop version: Whether ISO 4217 numeric */ static int bc_iso4217_numeric(int cc) { - static const short codes[179] = { + static const short codes[180] = { /*ALL*/ 8, /*DZD*/ 12, /*ARS*/ 32, /*AUD*/ 36, /*BSD*/ 44, /*BHD*/ 48, /*BDT*/ 50, /*AMD*/ 51, /*BBD*/ 52, /*BMD*/ 60, /*BTN*/ 64, /*BOB*/ 68, /*BWP*/ 72, /*BZD*/ 84, /*SBD*/ 90, /*BND*/ 96, /*MMK*/ 104, /*BIF*/ 108, /*KHR*/ 116, /*CAD*/ 124, /*CVE*/ 132, /*KYD*/ 136, /*LKR*/ 144, /*CLP*/ 152, /*CNY*/ 156, /*COP*/ 170, /*KMF*/ 174, /*CRC*/ 188, /*HRK*/ 191, /*CUP*/ 192, @@ -458,12 +460,12 @@ static int bc_iso4217_numeric(int cc) { /*PYG*/ 600, /*PEN*/ 604, /*PHP*/ 608, /*QAR*/ 634, /*RUB*/ 643, /*RWF*/ 646, /*SHP*/ 654, /*SAR*/ 682, /*SCR*/ 690, /*SLL*/ 694, /*SGD*/ 702, /*VND*/ 704, /*SOS*/ 706, /*ZAR*/ 710, /*SSP*/ 728, /*SZL*/ 748, /*SEK*/ 752, /*CHF*/ 756, /*SYP*/ 760, /*THB*/ 764, /*TOP*/ 776, /*TTD*/ 780, /*AED*/ 784, /*TND*/ 788, /*UGX*/ 800, /*MKD*/ 807, /*EGP*/ 818, /*GBP*/ 826, /*TZS*/ 834, /*USD*/ 840, - /*UYU*/ 858, /*UZS*/ 860, /*WST*/ 882, /*YER*/ 886, /*TWD*/ 901, /*UYW*/ 927, /*VES*/ 928, /*MRU*/ 929, /*STN*/ 930, /*CUC*/ 931, - /*ZWL*/ 932, /*BYN*/ 933, /*TMT*/ 934, /*GHS*/ 936, /*SDG*/ 938, /*UYI*/ 940, /*RSD*/ 941, /*MZN*/ 943, /*AZN*/ 944, /*RON*/ 946, - /*CHE*/ 947, /*CHW*/ 948, /*TRY*/ 949, /*XAF*/ 950, /*XCD*/ 951, /*XOF*/ 952, /*XPF*/ 953, /*XBA*/ 955, /*XBB*/ 956, /*XBC*/ 957, - /*XBD*/ 958, /*XAU*/ 959, /*XDR*/ 960, /*XAG*/ 961, /*XPT*/ 962, /*XTS*/ 963, /*XPD*/ 964, /*XUA*/ 965, /*ZMW*/ 967, /*SRD*/ 968, - /*MGA*/ 969, /*COU*/ 970, /*AFN*/ 971, /*TJS*/ 972, /*AOA*/ 973, /*BGN*/ 975, /*CDF*/ 976, /*BAM*/ 977, /*EUR*/ 978, /*MXV*/ 979, - /*UAH*/ 980, /*GEL*/ 981, /*BOV*/ 984, /*PLN*/ 985, /*BRL*/ 986, /*CLF*/ 990, /*XSU*/ 994, /*USN*/ 997, /*XXX*/ 999, + /*UYU*/ 858, /*UZS*/ 860, /*WST*/ 882, /*YER*/ 886, /*TWD*/ 901, /*SLE*/ 925, /*UYW*/ 927, /*VES*/ 928, /*MRU*/ 929, /*STN*/ 930, + /*CUC*/ 931, /*ZWL*/ 932, /*BYN*/ 933, /*TMT*/ 934, /*GHS*/ 936, /*SDG*/ 938, /*UYI*/ 940, /*RSD*/ 941, /*MZN*/ 943, /*AZN*/ 944, + /*RON*/ 946, /*CHE*/ 947, /*CHW*/ 948, /*TRY*/ 949, /*XAF*/ 950, /*XCD*/ 951, /*XOF*/ 952, /*XPF*/ 953, /*XBA*/ 955, /*XBB*/ 956, + /*XBC*/ 957, /*XBD*/ 958, /*XAU*/ 959, /*XDR*/ 960, /*XAG*/ 961, /*XPT*/ 962, /*XTS*/ 963, /*XPD*/ 964, /*XUA*/ 965, /*ZMW*/ 967, + /*SRD*/ 968, /*MGA*/ 969, /*COU*/ 970, /*AFN*/ 971, /*TJS*/ 972, /*AOA*/ 973, /*BGN*/ 975, /*CDF*/ 976, /*BAM*/ 977, /*EUR*/ 978, + /*MXV*/ 979, /*UAH*/ 980, /*GEL*/ 981, /*BOV*/ 984, /*PLN*/ 985, /*BRL*/ 986, /*CLF*/ 990, /*XSU*/ 994, /*USN*/ 997, /*XXX*/ 999, }; int s = 0, e = ARRAY_SIZE(codes) - 1; @@ -510,3 +512,5 @@ int main(int argc, char *argv[]) { return 0; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tests/tools/bwipp_dump-barcode.ps.diff b/backend/tests/tools/bwipp_dump-barcode.ps.diff index 082e074f..decc858d 100644 --- a/backend/tests/tools/bwipp_dump-barcode.ps.diff +++ b/backend/tests/tools/bwipp_dump-barcode.ps.diff @@ -1,6 +1,6 @@ ---- /home/mburke/code/bwipp/postscriptbarcode/build/monolithic/barcode.ps 2022-07-08 18:34:14.221029287 +0100 -+++ backend/tests/tools/bwipp_dump.ps 2022-07-08 18:29:43.830028306 +0100 -@@ -15706,8 +15706,8 @@ +--- /home/mburke/code/bwipp/postscriptbarcode/build/monolithic/barcode.ps 2022-07-14 20:00:40.532978330 +0100 ++++ backend/tests/tools/bwipp_dump.ps 2022-07-14 20:17:25.203302237 +0100 +@@ -16606,8 +16606,8 @@ } bind /fime { /sbs [2.25 6.75 2.25 15.75 2.25 6.75 2.25] def @@ -11,7 +11,7 @@ } bind >> def -@@ -27194,34 +27194,80 @@ +@@ -28094,34 +28094,80 @@ pop } ifelse @@ -111,7 +111,7 @@ end -@@ -27281,7 +27327,7 @@ +@@ -28181,7 +28227,7 @@ pop } ifelse @@ -120,7 +120,7 @@ % Get the result of encoding with ean8 and gs1-cc options (lintype) (ean8) put -@@ -27289,29 +27335,75 @@ +@@ -28189,29 +28235,75 @@ options (dontdraw) true put % Plot the linear part @@ -216,7 +216,7 @@ end -@@ -27371,34 +27463,80 @@ +@@ -28271,34 +28363,80 @@ pop } ifelse @@ -316,7 +316,7 @@ end -@@ -27473,34 +27611,80 @@ +@@ -28373,34 +28511,80 @@ /opt options >> def @@ -416,7 +416,7 @@ end -@@ -27560,7 +27744,7 @@ +@@ -28460,7 +28644,7 @@ pop } ifelse @@ -425,7 +425,7 @@ options (lintype) (databaromni) put options (linkage) true put -@@ -27571,7 +27755,7 @@ +@@ -28471,7 +28655,7 @@ linear options //databaromni exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -434,7 +434,7 @@ % Plot the separator /sepfinder { -@@ -27602,20 +27786,66 @@ +@@ -28502,20 +28686,66 @@ sep 0 [0 0 0] putinterval sep sep length 4 sub [0 0 0 0] putinterval 18 sepfinder 64 sepfinder @@ -513,7 +513,7 @@ end -@@ -27674,7 +27904,7 @@ +@@ -28574,7 +28804,7 @@ pop } ifelse @@ -522,7 +522,7 @@ options (lintype) (databarstacked) put options (linkage) true put -@@ -27685,7 +27915,7 @@ +@@ -28585,7 +28815,7 @@ linear options //databarstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -531,7 +531,7 @@ % Plot the separator /sepfinder { -@@ -27713,20 +27943,52 @@ +@@ -28613,20 +28843,52 @@ sep 0 [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder @@ -596,7 +596,7 @@ end -@@ -27785,7 +28047,7 @@ +@@ -28685,7 +28947,7 @@ pop } ifelse @@ -605,7 +605,7 @@ options (lintype) (databarstackedomni) put options (linkage) true put -@@ -27796,7 +28058,7 @@ +@@ -28696,7 +28958,7 @@ linear options //databarstackedomni exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -614,7 +614,7 @@ % Plot the separator /sepfinder { -@@ -27824,20 +28086,52 @@ +@@ -28724,20 +28986,52 @@ sep 0 [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder @@ -679,7 +679,7 @@ end -@@ -28012,7 +28306,7 @@ +@@ -28912,7 +29206,7 @@ pop } ifelse @@ -688,7 +688,7 @@ options (lintype) (databarlimited) put options (linkage) true put -@@ -28023,7 +28317,7 @@ +@@ -28923,7 +29217,7 @@ linear options //databarlimited exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -697,7 +697,7 @@ % Plot the separator mark -@@ -28031,22 +28325,68 @@ +@@ -28931,22 +29225,68 @@ counttomark 1 sub array astore /sep exch def pop pop sep 0 [0 0 0] putinterval sep sep length 9 sub [0 0 0 0 0 0 0 0 0] putinterval % 4 + 5 right guard spaces @@ -780,7 +780,7 @@ end -@@ -28106,7 +28446,7 @@ +@@ -29006,7 +29346,7 @@ pop } ifelse @@ -789,7 +789,7 @@ options (lintype) (databarexpanded) put options (linkage) true put -@@ -28117,7 +28457,7 @@ +@@ -29017,7 +29357,7 @@ linear options //databarexpanded exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -798,7 +798,7 @@ % Plot the separator /sepfinder { -@@ -28146,20 +28486,60 @@ +@@ -29046,20 +29386,60 @@ 18 98 bot length 13 sub {} for 69 98 bot length 13 sub {} for ] {sepfinder} forall @@ -871,7 +871,7 @@ end -@@ -28218,7 +28598,7 @@ +@@ -29118,7 +29498,7 @@ pop } ifelse @@ -880,7 +880,7 @@ options (lintype) (databarexpandedstacked) put options (linkage) true put -@@ -28229,7 +28609,7 @@ +@@ -29129,7 +29509,7 @@ linear options //databarexpandedstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -889,7 +889,7 @@ % Plot the separator /sepfinder { -@@ -28255,21 +28635,49 @@ +@@ -29155,21 +29535,49 @@ 19 98 bot length 13 sub {} for 70 98 bot length 13 sub {} for ] {sepfinder} forall @@ -952,7 +952,7 @@ end -@@ -28329,7 +28737,7 @@ +@@ -29229,7 +29637,7 @@ pop } ifelse @@ -961,7 +961,7 @@ options (inkspread) (0) put options (dontdraw) true put -@@ -28356,35 +28764,87 @@ +@@ -29256,35 +29664,87 @@ linear << options {} forall >> //gs1-128 exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -1063,7 +1063,7 @@ end -@@ -29934,3 +30394,189 @@ +@@ -30834,3 +31294,189 @@ % --END ENCODER hibcazteccode-- % --END TEMPLATE-- diff --git a/backend/tests/tools/bwipp_dump.ps.tar.xz b/backend/tests/tools/bwipp_dump.ps.tar.xz index 57845cef..35af5d9b 100644 Binary files a/backend/tests/tools/bwipp_dump.ps.tar.xz and b/backend/tests/tools/bwipp_dump.ps.tar.xz differ diff --git a/backend/tools/gen_gs1_lint.php b/backend/tools/gen_gs1_lint.php index 5154d92b..1016ffce 100644 --- a/backend/tools/gen_gs1_lint.php +++ b/backend/tools/gen_gs1_lint.php @@ -2,8 +2,10 @@ /* Generate GS1 verify include "backend/gs1_lint.h" for "backend/gs1.c" */ /* libzint - the open source barcode library - Copyright (C) 2021 -*/ + Copyright (C) 2021-2022 + */ +/* SPDX-License-Identifier: BSD-3-Clause */ + /* To create "backend/gs1_lint.h" (from project directory): * * php backend/tools/gen_gs1_lint.php > backend/gs1_lint.h @@ -12,8 +14,12 @@ * * php backend/tools/gen_gs1_lint.php -f /gs1-format-spec.txt backend/gs1_lint.h * + ************************************************************************************************* + * NOTE: for up-to-update version requires syntax dictionary that will be available from + * https://github.com/gs1/gs1-syntax-dictionary + * on its release. For now this generator should only be run by someone with a pre-release copy!!! + ************************************************************************************************* */ -/* vim: set ts=4 sw=4 et : */ $basename = basename(__FILE__); $dirname = dirname(__FILE__); @@ -22,8 +28,11 @@ $dirdirname = basename(dirname($dirname)) . '/' . basename($dirname); $opts = getopt('c:f:h:l:t:'); $print_copyright = isset($opts['c']) ? (bool) $opts['c'] : true; -$file = isset($opts['f']) ? $opts['f'] : - 'https://raw.githubusercontent.com/bwipp/postscriptbarcode/master/contrib/development/gs1-format-spec.txt'; +if (!isset($opts['f'])) { // TODO: temporary hack + exit("$basename:" . __LINE__ + . " ERROR: For now this generator must only be run locally with a pre-release syntax dictionary" . PHP_EOL); +} +$file = $opts['f']; $print_h_guard = isset($opts['h']) ? (bool) $opts['h'] : true; $use_length_only = isset($opts['l']) ? (bool) $opts['l'] : true; $tab = isset($opts['t']) ? $opts['t'] : ' '; @@ -31,6 +40,9 @@ $tab = isset($opts['t']) ? $opts['t'] : ' '; if (($get = file_get_contents($file)) === false) { exit("$basename:" . __LINE__ . " ERROR: Could not read file \"$file\"" . PHP_EOL); } +// Strip to last 2 directories TODO: temporary hack +$stripped_dir = dirname($file); +$stripped_file = basename(dirname($stripped_dir)) . '/' . basename($stripped_dir) . '/' . basename($file); $lines = explode("\n", $get); @@ -44,12 +56,14 @@ foreach ($lines as $line) { if ($line === '' || $line[0] === '#') { continue; } - if (!preg_match('/^([0-9]+(?:-[0-9]+)?) +([ *] )([NXC][0-9.][ NXC0-9.,a-z=|]*)(?:# (.+))?$/', $line, $matches)) { + if (!preg_match('/^([0-9]+(?:-[0-9]+)?) +([ *] )([NXYC][0-9.][ NXYC0-9.,a-z=|\[\]]*)(?:# (.+))?$/', $line, $matches)) { exit("$basename:" . __LINE__ . " ERROR: Could not parse line $line_no" . PHP_EOL); } $ai = $matches[1]; $fixed = trim($matches[2]); - $spec = preg_replace('/ +dlpkey[=0-9,|]*/', '', trim($matches[3])); // Strip Digital Link primary key info + $spec = preg_replace('/ +req=[0-9,n]*/', '', trim($matches[3])); // Strip mandatory association info + $spec = preg_replace('/ +ex=[0-9,n]*/', '', $spec); // Strip invalid pairings info + $spec = preg_replace('/ +dlpkey[=0-9,|]*/', '', $spec); // Strip Digital Link primary key info $comment = isset($matches[4]) ? trim($matches[4]) : ''; if (isset($spec_ais[$spec])) { @@ -108,22 +122,38 @@ foreach ($lines as $line) { foreach ($parts as $part) { $checkers = explode(',', $part); $validator = array_shift($checkers); - if (!preg_match('/^([NXC])([0-9]+)?(\.\.[0-9|]+)?$/', $validator, $matches)) { + if (preg_match('/^([NXYC])([0-9]+)?(\.\.[0-9|]+)?$/', $validator, $matches)) { + if (count($matches) === 3) { + $min = $max = (int) $matches[2]; + } else { + $min = $matches[2] === '' ? 1 : (int) $matches[2]; + $max = (int) substr($matches[3], 2); + } + if ($matches[1] === 'N') { + $validator = "numeric"; + } elseif ($matches[1] === 'X') { + $validator = "cset82"; + } else { + $validator = "cset39"; + } + } else if (preg_match('/^\[([NXYC])([1-9]+)?(\.\.[0-9|]+)?\]$/', $validator, $matches)) { + if (count($matches) === 3) { + $min = 0; + $max = (int) $matches[2]; + } else { + $min = $matches[2] === '' ? 0 : (int) $matches[2]; + $max = (int) substr($matches[3], 2); + } + if ($matches[1] === 'N') { + $validator = "numeric"; + } elseif ($matches[1] === 'X') { + $validator = "cset82"; + } else { + $validator = "cset39"; + } + } else { exit("$basename:" . __LINE__ . " ERROR: Could not parse validator \"$validator\" line $line_no" . PHP_EOL); } - if (count($matches) === 3) { - $min = $max = (int) $matches[2]; - } else { - $min = $matches[2] === '' ? 1 : (int) $matches[2]; - $max = (int) substr($matches[3], 2); - } - if ($matches[1] === 'N') { - $validator = "numeric"; - } elseif ($matches[1] === 'X') { - $validator = "cset82"; - } else { - $validator = "cset39"; - } $spec_parts[$spec][] = array($min, $max, $validator, $checkers); } } @@ -196,7 +226,7 @@ foreach ($spec_ais as $spec => $ais) { print << + Copyright (C) 2021-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -232,6 +262,7 @@ print <<<'EOD' OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* SPDX-License-Identifier: BSD-3-Clause */ EOD; @@ -239,8 +270,8 @@ EOD; if ($print_h_guard) { print <<<'EOD' -#ifndef GS1_LINT_H -#define GS1_LINT_H +#ifndef Z_GS1_LINT_H +#define Z_GS1_LINT_H EOD; @@ -249,7 +280,7 @@ EOD; // Print the spec validator/checkers functions foreach ($spec_parts as $spec => $spec_part) { - $spec_funcs[$spec] = $spec_func = str_replace(array(' ', '.', ','), '_', strtolower($spec)); + $spec_funcs[$spec] = $spec_func = str_replace(array(' ', '.', ',', '[', ']'), '_', strtolower($spec)); $comment = ''; if (isset($spec_comments[$spec])) { $comment = ' (Used by'; @@ -437,7 +468,9 @@ EOD; if ($print_h_guard) { print <<<'EOD' -#endif /* GS1_LINT_H */ +#endif /* Z_GS1_LINT_H */ EOD; } + +/* vim: set ts=4 sw=4 et : */ diff --git a/backend/tools/gen_iso4217_h.php b/backend/tools/gen_iso4217_h.php index 277e01eb..4dba2881 100644 --- a/backend/tools/gen_iso4217_h.php +++ b/backend/tools/gen_iso4217_h.php @@ -2,13 +2,14 @@ /* Generate ISO 4217 include "backend/iso4217.h" for "backend/gs1.c" */ /* libzint - the open source barcode library - Copyright (C) 2021 + Copyright (C) 2021-2022 */ +/* SPDX-License-Identifier: BSD-3-Clause */ + /* To create "backend/iso4217.h" (from project directory): * * php backend/tools/gen_iso4217_h.php > backend/iso4217.h */ -/* vim: set ts=4 sw=4 et : */ $basename = basename(__FILE__); $dirname = dirname(__FILE__); @@ -33,12 +34,12 @@ $numeric = array( /*PYG*/ 600, /*PEN*/ 604, /*PHP*/ 608, /*QAR*/ 634, /*RUB*/ 643, /*RWF*/ 646, /*SHP*/ 654, /*SAR*/ 682, /*SCR*/ 690, /*SLL*/ 694, /*SGD*/ 702, /*VND*/ 704, /*SOS*/ 706, /*ZAR*/ 710, /*SSP*/ 728, /*SZL*/ 748, /*SEK*/ 752, /*CHF*/ 756, /*SYP*/ 760, /*THB*/ 764, /*TOP*/ 776, /*TTD*/ 780, /*AED*/ 784, /*TND*/ 788, /*UGX*/ 800, /*MKD*/ 807, /*EGP*/ 818, /*GBP*/ 826, /*TZS*/ 834, /*USD*/ 840, - /*UYU*/ 858, /*UZS*/ 860, /*WST*/ 882, /*YER*/ 886, /*TWD*/ 901, /*UYW*/ 927, /*VES*/ 928, /*MRU*/ 929, /*STN*/ 930, /*CUC*/ 931, - /*ZWL*/ 932, /*BYN*/ 933, /*TMT*/ 934, /*GHS*/ 936, /*SDG*/ 938, /*UYI*/ 940, /*RSD*/ 941, /*MZN*/ 943, /*AZN*/ 944, /*RON*/ 946, - /*CHE*/ 947, /*CHW*/ 948, /*TRY*/ 949, /*XAF*/ 950, /*XCD*/ 951, /*XOF*/ 952, /*XPF*/ 953, /*XBA*/ 955, /*XBB*/ 956, /*XBC*/ 957, - /*XBD*/ 958, /*XAU*/ 959, /*XDR*/ 960, /*XAG*/ 961, /*XPT*/ 962, /*XTS*/ 963, /*XPD*/ 964, /*XUA*/ 965, /*ZMW*/ 967, /*SRD*/ 968, - /*MGA*/ 969, /*COU*/ 970, /*AFN*/ 971, /*TJS*/ 972, /*AOA*/ 973, /*BGN*/ 975, /*CDF*/ 976, /*BAM*/ 977, /*EUR*/ 978, /*MXV*/ 979, - /*UAH*/ 980, /*GEL*/ 981, /*BOV*/ 984, /*PLN*/ 985, /*BRL*/ 986, /*CLF*/ 990, /*XSU*/ 994, /*USN*/ 997, /*XXX*/ 999, + /*UYU*/ 858, /*UZS*/ 860, /*WST*/ 882, /*YER*/ 886, /*TWD*/ 901, /*SLE*/ 925, /*UYW*/ 927, /*VES*/ 928, /*MRU*/ 929, /*STN*/ 930, + /*CUC*/ 931, /*ZWL*/ 932, /*BYN*/ 933, /*TMT*/ 934, /*GHS*/ 936, /*SDG*/ 938, /*UYI*/ 940, /*RSD*/ 941, /*MZN*/ 943, /*AZN*/ 944, + /*RON*/ 946, /*CHE*/ 947, /*CHW*/ 948, /*TRY*/ 949, /*XAF*/ 950, /*XCD*/ 951, /*XOF*/ 952, /*XPF*/ 953, /*XBA*/ 955, /*XBB*/ 956, + /*XBC*/ 957, /*XBD*/ 958, /*XAU*/ 959, /*XDR*/ 960, /*XAG*/ 961, /*XPT*/ 962, /*XTS*/ 963, /*XPD*/ 964, /*XUA*/ 965, /*ZMW*/ 967, + /*SRD*/ 968, /*MGA*/ 969, /*COU*/ 970, /*AFN*/ 971, /*TJS*/ 972, /*AOA*/ 973, /*BGN*/ 975, /*CDF*/ 976, /*BAM*/ 977, /*EUR*/ 978, + /*MXV*/ 979, /*UAH*/ 980, /*GEL*/ 981, /*BOV*/ 984, /*PLN*/ 985, /*BRL*/ 986, /*CLF*/ 990, /*XSU*/ 994, /*USN*/ 997, /*XXX*/ 999, ); $numeric_tab = array(); @@ -68,7 +69,7 @@ if ($print_copyright) { print <<<'EOD' /* libzint - the open source barcode library - Copyright (C) 2021 Robin Stuart + Copyright (C) 2021-2022 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -95,6 +96,7 @@ print <<<'EOD' OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* SPDX-License-Identifier: BSD-3-Clause */ EOD; @@ -102,8 +104,8 @@ EOD; if ($print_h_guard) { print <<<'EOD' -#ifndef ISO4217_H -#define ISO4217_H +#ifndef Z_ISO4217_H +#define Z_ISO4217_H EOD; } @@ -139,7 +141,9 @@ EOD; if ($print_h_guard) { print <<<'EOD' -#endif /* ISO4217_H */ +#endif /* Z_ISO4217_H */ EOD; } + +/* vim: set ts=4 sw=4 et : */