aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/UniConversion.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/UniConversion.cxx b/src/UniConversion.cxx
index 40ac982c9..ffe67f75c 100644
--- a/src/UniConversion.cxx
+++ b/src/UniConversion.cxx
@@ -240,11 +240,9 @@ int UTF8Classify(const unsigned char *us, int len) {
} else {
return UTF8MaskInvalid | 1;
}
- } else if (*us >= 0xc0) {
- // Overlong encoding
- return UTF8MaskInvalid | 1;
} else {
- // Trail byte
+ // 0xc0 .. 0xc1 is overlong encoding
+ // 0x80 .. 0xbf is trail byte
return UTF8MaskInvalid | 1;
}
}