From a759d33b90e0889ba6d57a206d71ded4fe8af728 Mon Sep 17 00:00:00 2001 From: Brandyn White Date: Sun, 2 Feb 2014 02:43:23 -0500 Subject: [PATCH] Don't decode utf-8 as it may not be --- msgpack.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/msgpack.js b/msgpack.js index 46ed0cb2..765915f2 100644 --- a/msgpack.js +++ b/msgpack.js @@ -345,10 +345,7 @@ function decode() { // @return Mix: case 0xa0: // utf8.decode for (ary = [], i = _idx, iz = i + num; i < iz; ) { c = buf[++i]; // lead byte - ary.push(c < 0x80 ? c : // ASCII(0x00 ~ 0x7f) - c < 0xe0 ? ((c & 0x1f) << 6 | (buf[++i] & 0x3f)) : - ((c & 0x0f) << 12 | (buf[++i] & 0x3f) << 6 - | (buf[++i] & 0x3f))); + ary.push(c); } _idx = i; return ary.length < 10240 ? _toString.apply(null, ary)