提交 45c15c79 编写于 作者: K kkruups 提交者: GitHub

Fixed Bug in Double Byte Code in utf8Read

Code before fix was extracting 4-bits from 1st utf8 Byte instead of 5 bits, resulting in 10-bit binary number instead of 11-bit as specified for Double Byte.
上级 6e0892b9
......@@ -87,7 +87,7 @@ function utf8Read(view, offset, length) {
// Two byte character
if ((byte & 0xe0) === 0xc0) {
string += String.fromCharCode(
((byte & 0x0f) << 6) |
((byte & 0x1f) << 6) |
(view.getUint8(++i) & 0x3f)
);
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册