summaryrefslogtreecommitdiff
path: root/core/src/xmake/utf8/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/xmake/utf8/utf8.c')
-rw-r--r--core/src/xmake/utf8/utf8.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/xmake/utf8/utf8.c b/core/src/xmake/utf8/utf8.c
index ace3a213c..1e76c2a7e 100644
--- a/core/src/xmake/utf8/utf8.c
+++ b/core/src/xmake/utf8/utf8.c
@@ -35,6 +35,9 @@ tb_char_t const* xm_utf8_decode(tb_char_t const* s, xm_utf8_int_t* val, tb_bool_
if (c < 0x80) {
res = c;
} else {
+ if (xm_utf8_iscont(c)) {
+ return tb_null;
+ }
tb_int_t count = 0;
for (; c & 0x40; c <<= 1) {
tb_uint32_t cc = (tb_byte_t)s[++count];