Use is_utf8() instead, for more readable.
authorFreeBirdLjj <ljj11011@mail.ustc.edu.cn>
Wed, 24 Sep 2014 17:05:56 +0000 (01:05 +0800)
committerFreeBirdLjj <ljj11011@mail.ustc.edu.cn>
Wed, 24 Sep 2014 17:05:56 +0000 (01:05 +0800)
src/parser.c

index 6f5c4c8..478da5b 100644 (file)
@@ -382,7 +382,7 @@ int length_utf8(char ch) {
 
     int i = 0; // increment
 
-    while(ch & 0x80) {
+    while(is_utf8(ch)) {
         i++;
         ch <<= 1;
     }