mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13: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