소스 검색

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.
kkruups 8 년 전
부모
커밋
45c15c792f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      examples/js/libs/msgpack-js.js

+ 1 - 1
examples/js/libs/msgpack-js.js

@@ -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;