eci: Add support for all ECIs (Big5, Korean, UCS-2BE)

This commit is contained in:
gitlost 2021-01-11 18:11:41 +00:00
parent 9795049322
commit 7fe930b4dc
53 changed files with 51324 additions and 907 deletions

View file

@ -2,7 +2,7 @@
/*
libzint - the open source barcode library
Copyright (C) 2008 - 2020 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2008 - 2021 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -85,6 +85,18 @@ INTERNAL void to_upper(unsigned char source[]) {
}
}
/* Returns the number of times a character occurs in a string */
INTERNAL int chr_cnt(const unsigned char string[], const int length, const unsigned char c) {
int count = 0;
int i;
for (i = 0; i < length; i++) {
if (string[i] == c) {
count++;
}
}
return count;
}
/* Verifies that a string only uses valid characters */
INTERNAL int is_sane(const char test_string[], const unsigned char source[], const int length) {
int i, j, lt = (int) strlen(test_string);