mirror of
https://git.code.sf.net/p/zint/code
synced 2026-02-02 08:45:58 +00:00
get_best_eci: check UTF-8 before returning 26; move is_valid_utf8 to common
This commit is contained in:
@@ -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!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user