Always latch to non-numeric in general-purpose field

Would not include latch to alphanumeric or ISO/IEC mode if required at the beginning of a general-purpose compaction field.
Fixes #146 reported by Gregory Van Vooren
This commit is contained in:
Robin Stuart 2019-10-05 12:48:55 +01:00
parent ae737ea019
commit eb3a004ace

View File

@ -1421,6 +1421,8 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha
if (general_field_type[i - 1] == ISOIEC) { if (general_field_type[i - 1] == ISOIEC) {
bin_append(4, 5, binary_string); /* ISO/IEC 646 latch */ bin_append(4, 5, binary_string); /* ISO/IEC 646 latch */
} }
} else {
bin_append(0, 4, binary_string); /* Alphanumeric latch */
} }
if ((general_field[i] >= '0') && (general_field[i] <= '9')) { if ((general_field[i] >= '0') && (general_field[i] <= '9')) {
@ -1465,6 +1467,9 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha
if (general_field_type[i - 1] == ALPHA) { if (general_field_type[i - 1] == ALPHA) {
bin_append(4, 5, binary_string);; /* ISO/IEC 646 latch */ bin_append(4, 5, binary_string);; /* ISO/IEC 646 latch */
} }
} else {
bin_append(0, 4, binary_string); /* Alphanumeric latch */
bin_append(4, 5, binary_string); /* ISO/IEC 646 latch */
} }
if ((general_field[i] >= '0') && (general_field[i] <= '9')) { if ((general_field[i] >= '0') && (general_field[i] <= '9')) {