(buf, start, end)
| 926 | } |
| 927 | |
| 928 | function utf8Slice (buf, start, end) { |
| 929 | var res = '' |
| 930 | var tmp = '' |
| 931 | end = Math.min(buf.length, end) |
| 932 | |
| 933 | for (var i = start; i < end; i++) { |
| 934 | if (buf[i] <= 0x7F) { |
| 935 | res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]) |
| 936 | tmp = '' |
| 937 | } else { |
| 938 | tmp += '%' + buf[i].toString(16) |
| 939 | } |
| 940 | } |
| 941 | |
| 942 | return res + decodeUtf8Char(tmp) |
| 943 | } |
| 944 | |
| 945 | function asciiSlice (buf, start, end) { |
| 946 | var ret = '' |
no test coverage detected