git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e46e09
)
lib/util/charset correct calculation of UTF8 character sizes
author
Andrew Bartlett
<abartlet@samba.org>
Wed, 30 Mar 2011 23:26:08 +0000
(10:26 +1100)
committer
Andrew Bartlett
<abartlet@samba.org>
Wed, 30 Mar 2011 23:52:42 +0000
(10:52 +1100)
Characters between 0x800 0x0FFFF are 3 bytes long.
Andrew Bartlett
lib/util/charset/util_str.c
patch
|
blob
|
history
diff --git
a/lib/util/charset/util_str.c
b/lib/util/charset/util_str.c
index 30961d068a3eed3fa03cf24f1e6252c54e6381bd..ff53b1875ea0022f42875a52483a4c8c73f5b35b 100644
(file)
--- 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 < 0x1000
0
) {
count += 3;
} else {
count += 4;