summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2014-03-31 21:43:35 +0000
committernicm <nicm>2014-03-31 21:43:35 +0000
commitee19d304ff366741f6f94334bbc82124a4c44dbc (patch)
treef62f6cacf0fbfd929798a56faa69690753510f49
parent48478ea0a990cc14d61722f9f8d3f1490d8f417a (diff)
In four byte UTF-8 sequences, only three bits of the first byte should
be used. Fix from Koga Osamu.
-rw-r--r--utf8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index 1c81392b..85889dcb 100644
--- a/utf8.c
+++ b/utf8.c
@@ -311,7 +311,7 @@ utf8_combine(const struct utf8_data *utf8data)
value = utf8data->data[3] & 0x3f;
value |= (utf8data->data[2] & 0x3f) << 6;
value |= (utf8data->data[1] & 0x3f) << 12;
- value |= (utf8data->data[0] & 0x3f) << 18;
+ value |= (utf8data->data[0] & 0x07) << 18;
break;
}
return (value);