1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-17 09:57:02 +00:00

ECI: Update ECIs to AIM ITS/04-023:2022, adding UTF-16BE (was USC-2BE),

UTF-16LE, GBK, separate GB18030, UTF-32BE, UTF-32LE
  add examples to tests for DATAMATRIX, HANXIN, QRCODE
HANXIN: Remove alternating filler in function information;
  GB 18030 now ECI 32 (previously used ECI 29);
  fix gate-posts on codeword limits
  use new ZXing-C++ HanXin detector (diagnostics2 branch) for tests
  check against ISO/IEC 20830:2021 (no substantive changes)
backend_tcl: update ECIs; NOTE: changed names "unicode" -> "utf-16be",
  "euc-cn" -> "gb2312"
GRIDMATRIX/HANXIN/QRCODE/RMQR: warn if auto-conversion (i.e. no ECI given)
  occurs to resp. specialized char sets (GB 2312/GB 18030/Shift JIS)
This commit is contained in:
gitlost
2022-04-10 11:12:18 +01:00
parent 69876619dd
commit 624d40021e
38 changed files with 5761 additions and 835 deletions

View File

@@ -1,7 +1,7 @@
/* gridmtx.c - Grid Matrix
libzint - the open source barcode library
Copyright (C) 2009-2021 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -28,7 +28,6 @@
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
/* vim: set ts=4 sw=4 et : */
/* This file implements Grid Matrix as specified in
AIM Global Document Number AIMD014 Rev. 1.63 Revised 9 Dec 2008 */
@@ -1011,6 +1010,7 @@ static void place_layer_id(char *grid, int size, int layers, int modules, int ec
}
INTERNAL int gridmatrix(struct zint_symbol *symbol, unsigned char source[], int length) {
int warn_number = 0;
int size, modules, error_number;
int auto_layers, min_layers, layers, auto_ecc_level, min_ecc_level, ecc_level;
int x, y, i;
@@ -1038,7 +1038,7 @@ INTERNAL int gridmatrix(struct zint_symbol *symbol, unsigned char source[], int
gb2312_cpy(source, &length, gbdata, full_multibyte);
} else {
int done = 0;
if (symbol->eci != 29) { /* Unless ECI 29 (GB) */
if (symbol->eci != 29) { /* Unless ECI 29 (GB 2312) */
/* Try other conversions (ECI 0 defaults to ISO/IEC 8859-1) */
error_number = gb2312_utf8_to_eci(symbol->eci, source, &length, gbdata, full_multibyte);
if (error_number == 0) {
@@ -1054,6 +1054,10 @@ INTERNAL int gridmatrix(struct zint_symbol *symbol, unsigned char source[], int
if (error_number != 0) {
return error_number;
}
if (symbol->eci != 29) {
strcpy(symbol->errtxt, "540: Converted to GB 2312 but no ECI specified");
warn_number = ZINT_WARN_NONCOMPLIANT;
}
}
}
@@ -1237,5 +1241,7 @@ INTERNAL int gridmatrix(struct zint_symbol *symbol, unsigned char source[], int
}
symbol->height = size;
return 0;
return warn_number;
}
/* vim: set ts=4 sw=4 et : */