1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-19 02:47:06 +00:00

RAW_TEXT: change source to be unconverted, i.e. UTF-8 (unless

`DATA_MODE`); allows ZXing-C++ to be built in writer-only mode
  without needing "libzueci"
library: in GS1 mode check that ECI if any is ASCII compatible
general: some code fiddling, `mode` -> `modes`
This commit is contained in:
gitlost
2025-09-05 17:23:18 +01:00
parent 44e2099a65
commit 9b4d097516
39 changed files with 798 additions and 630 deletions

View File

@@ -1929,9 +1929,9 @@ static void test_rt(const testCtx *const p_ctx) {
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
/* 0*/ { UNICODE_MODE, -1, -1, "é", -1, 0, 0, "", -1, 0 },
/* 1*/ { UNICODE_MODE, -1, BARCODE_RAW_TEXT, "é", -1, 0, 0, "\351", -1, 3 },
/* 1*/ { UNICODE_MODE, -1, BARCODE_RAW_TEXT, "é", -1, 0, 0, "é", -1, 3 }, /* Now UTF-8, not converted */
/* 2*/ { UNICODE_MODE, -1, -1, "", -1, ZINT_WARN_USES_ECI, 13, "", -1, 0 },
/* 3*/ { UNICODE_MODE, -1, BARCODE_RAW_TEXT, "", -1, ZINT_WARN_USES_ECI, 13, "\241", -1, 13 },
/* 3*/ { UNICODE_MODE, -1, BARCODE_RAW_TEXT, "", -1, ZINT_WARN_USES_ECI, 13, "", -1, 13 },
/* 4*/ { DATA_MODE, -1, -1, "\351", -1, 0, 0, "", -1, 0 },
/* 5*/ { DATA_MODE, -1, BARCODE_RAW_TEXT, "\351", -1, 0, 0, "\351", -1, 3 },
/* 6*/ { UNICODE_MODE, 26, -1, "é", -1, 0, 26, "", -1, 0 },
@@ -2012,9 +2012,9 @@ static void test_rt_segs(const testCtx *const p_ctx) {
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
/* 0*/ { UNICODE_MODE, -1, { { TU(""), -1, 0 }, { TU("Ж"), -1, 7 }, {0} }, 0, 33, 30, {{0}}, 0 },
/* 1*/ { UNICODE_MODE, BARCODE_RAW_TEXT, { { TU(""), -1, 0 }, { TU("Ж"), -1, 7 }, { TU(""), 0, 0 } }, 0, 33, 30, { { TU("\266"), 1, 3 }, { TU("\266"), 1, 7 }, {0} }, 2 },
/* 1*/ { UNICODE_MODE, BARCODE_RAW_TEXT, { { TU(""), -1, 0 }, { TU("Ж"), -1, 7 }, { TU(""), 0, 0 } }, 0, 33, 30, { { TU(""), 2, 3 }, { TU("Ж"), 2, 7 }, {0} }, 2 }, /* Now UTF-8, not converted */
/* 2*/ { UNICODE_MODE, -1, { { TU("éé"), -1, 0 }, { TU("กขฯ"), -1, 0 }, { TU("βββ"), -1, 0 } }, ZINT_WARN_USES_ECI, 33, 30, {{0}}, 0 },
/* 3*/ { UNICODE_MODE, BARCODE_RAW_TEXT, { { TU("éé"), -1, 0 }, { TU("กขฯ"), -1, 0 }, { TU("βββ"), -1, 0 } }, ZINT_WARN_USES_ECI, 33, 30, { { TU("\351\351"), 2, 3 }, { TU("\241\242\317"), 3, 13 }, { TU("\342\342\342"), 3, 9 } }, 3 },
/* 3*/ { UNICODE_MODE, BARCODE_RAW_TEXT, { { TU("éé"), -1, 0 }, { TU("กขฯ"), -1, 0 }, { TU("βββ"), -1, 0 } }, ZINT_WARN_USES_ECI, 33, 30, { { TU("éé"), 4, 3 }, { TU("กขฯ"), 9, 13 }, { TU("βββ"), 6, 9 } }, 3 },
/* 4*/ { DATA_MODE, -1, { { TU(""), -1, 26 }, { TU("Ж"), -1, 0 }, { TU("\223\137"), -1, 20 } }, 0, 33, 30, {{0}}, 0 },
/* 5*/ { DATA_MODE, BARCODE_RAW_TEXT, { { TU(""), -1, 26 }, { TU("Ж"), -1, 0 }, { TU("\223\137"), -1, 20 } }, 0, 33, 30, { { TU(""), 2, 26 }, { TU("\320\226"), 2, 3 }, { TU("\223\137"), 2, 20 } }, 3 },
};