From 46db53b1596cccdd22cf44dc376e39601f01c29c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 31 Mar 2011 10:26:08 +1100 Subject: lib/util/charset correct calculation of UTF8 character sizes Characters between 0x800 0x0FFFF are 3 bytes long. Andrew Bartlett --- lib/util/charset/util_str.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/util/charset/util_str.c') diff --git a/lib/util/charset/util_str.c b/lib/util/charset/util_str.c index 30961d068a..ff53b1875e 100644 --- a/lib/util/charset/util_str.c +++ b/lib/util/charset/util_str.c @@ -184,7 +184,7 @@ _PUBLIC_ size_t strlen_m_ext(const char *s, charset_t src_charset, charset_t dst count += 1; } else if (c < 0x800) { count += 2; - } else if (c < 0x1000) { + } else if (c < 0x10000) { count += 3; } else { count += 4; -- cgit