mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
eci: Add support for all ECIs (Big5, Korean, UCS-2BE)
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user