From d70edce067bcfdae399ce0ef19bbdf4bd975f4bb Mon Sep 17 00:00:00 2001 From: gitlost Date: Fri, 21 Jun 2024 16:31:19 +0100 Subject: [PATCH] iso4217: new ISO 4217 currency code 924 for ZWG (amendment no. 177) (gs1-syntax-dictionary commit [d64e28d]) TODO: remove 932 ZWL 1 Sept 2024 --- backend/iso4217.h | 4 ++-- backend/tests/test_iso4217.c | 13 +++++++------ backend/tools/gen_iso4217_h.php | 9 +++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/backend/iso4217.h b/backend/iso4217.h index 14b9e441..c5ebc8ac 100644 --- a/backend/iso4217.h +++ b/backend/iso4217.h @@ -3,7 +3,7 @@ */ /* libzint - the open source barcode library - Copyright (C) 2021-2022 Robin Stuart + Copyright (C) 2021-2024 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -52,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, 0xA0, 0x7F, 0xB5, 0xFD, 0xFB, + 0x20, 0x00, 0x00, 0xB0, 0x7F, 0xB5, 0xFD, 0xFB, 0xBF, 0xBF, 0x3F, 0x47, 0xA4, }; int b = cc >> 3; diff --git a/backend/tests/test_iso4217.c b/backend/tests/test_iso4217.c index 5d6e8d26..b36bcbc0 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-2022 Robin Stuart + Copyright (C) 2021-2024 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -350,7 +350,7 @@ static void test_numeric(const testCtx *const p_ctx) { /*307*/ { 900, 0 }, /*308*/ { 901, 1 }, /*309*/ { 902, 0 }, - /*310*/ { 924, 0 }, + /*310*/ { 924, 1 }, /*311*/ { 925, 1 }, /*312*/ { 926, 0 }, /*313*/ { 927, 1 }, @@ -358,7 +358,7 @@ static void test_numeric(const testCtx *const p_ctx) { /*315*/ { 929, 1 }, /*316*/ { 930, 1 }, /*317*/ { 931, 1 }, - /*318*/ { 932, 1 }, + /*318*/ { 932, 1 }, /* TODO: 1 -> 0, 1 Sept 2024 */ /*319*/ { 933, 1 }, /*320*/ { 934, 1 }, /*321*/ { 935, 0 }, @@ -447,7 +447,7 @@ static void test_numeric(const testCtx *const p_ctx) { /* Binary chop version: Whether ISO 4217 numeric */ static int bc_iso4217_numeric(int cc) { - static const short codes[180] = { + static const short codes[181] = { /*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, @@ -460,8 +460,9 @@ 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, /*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, + /*UYU*/ 858, /*UZS*/ 860, /*WST*/ 882, /*YER*/ 886, /*TWD*/ 901, /*ZWG*/ 924, /*SLE*/ 925, /*UYW*/ 927, /*VES*/ 928, /*MRU*/ 929, + /*STN*/ 930, /*CUC*/ 931, /*ZWL*/ 932, /* TODO: remove 1 Sept 2024 */ + /*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, diff --git a/backend/tools/gen_iso4217_h.php b/backend/tools/gen_iso4217_h.php index 4dba2881..9b843247 100644 --- a/backend/tools/gen_iso4217_h.php +++ b/backend/tools/gen_iso4217_h.php @@ -2,7 +2,7 @@ /* Generate ISO 4217 include "backend/iso4217.h" for "backend/gs1.c" */ /* libzint - the open source barcode library - Copyright (C) 2021-2022 + Copyright (C) 2021-2024 */ /* SPDX-License-Identifier: BSD-3-Clause */ @@ -34,8 +34,9 @@ $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, /*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, + /*UYU*/ 858, /*UZS*/ 860, /*WST*/ 882, /*YER*/ 886, /*TWD*/ 901, /*ZWG*/ 924, /*SLE*/ 925, /*UYW*/ 927, /*VES*/ 928, /*MRU*/ 929, + /*STN*/ 930, /*CUC*/ 931, /*ZWL*/ 932, /* TODO: remove 1 Sept 2024 */ + /*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, @@ -69,7 +70,7 @@ if ($print_copyright) { print <<<'EOD' /* libzint - the open source barcode library - Copyright (C) 2021-2022 Robin Stuart + Copyright (C) 2021-2024 Robin Stuart Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions