mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-27 21:44:13 -04:00
get_best_eci: check UTF-8 before returning 26; move is_valid_utf8 to common
This commit is contained in:
parent
7f74414666
commit
2d962c6321
7 changed files with 104 additions and 64 deletions
|
@ -271,5 +271,9 @@ INTERNAL int get_best_eci(const unsigned char source[], int length) {
|
|||
eci++;
|
||||
} while (eci < 25);
|
||||
|
||||
if (!is_valid_utf8(source, length)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 26; // If all of these fail, use Unicode!
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue