Use constant for maximum UTF-8 character size
Introduce a UTF8_MAXLEN constant instead of using the literal value "6" at various places. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
@@ -200,6 +200,7 @@
|
||||
#define TOSTRING(x) STRINGIFY(x)
|
||||
#define __FILE_POS__ __FILE__ ":" TOSTRING(__LINE__)
|
||||
|
||||
#define UTF8_MAXLEN 6
|
||||
#define UTF8_LENGTH(ch) ((unsigned char)ch >= 0xFC ? 6 : \
|
||||
((unsigned char)ch >= 0xF8 ? 5 : \
|
||||
((unsigned char)ch >= 0xF0 ? 4 : \
|
||||
|
||||
Reference in New Issue
Block a user