CODE128: hrt always UTF-8; CODE128/EXCODE39/CODE93: blank same NUL/ctrl/DEL chars

This commit is contained in:
gitlost
2020-07-19 00:13:03 +01:00
parent 020a125de6
commit dd2bdb4335
14 changed files with 233 additions and 133 deletions

View File

@ -391,7 +391,7 @@ INTERNAL int ec39(struct zint_symbol *symbol, unsigned char source[], int length
error_number = c39(symbol, buffer, ustrlen(buffer));
for (i = 0; i < length; i++)
symbol->text[i] = source[i] ? source[i] : ' ';
symbol->text[i] = source[i] >= ' ' && source[i] != 0x7F ? source[i] : ' ';
symbol->text[length] = '\0';
return error_number;
@ -426,7 +426,7 @@ INTERNAL int c93(struct zint_symbol *symbol, unsigned char source[], int length)
return ZINT_ERROR_INVALID_DATA;
}
strcat(buffer, C93Ctrl[source[i]]);
symbol->text[i] = source[i] ? source[i] : ' ';
symbol->text[i] = source[i] >= ' ' && source[i] != 0x7F ? source[i] : ' ';
}
/* Now we can check the true length of the barcode */