Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a nasty IE bug where it's unable to parse the unicode charactur…

…e when it's

looked up using data[0]. It will return undefined instead the actual char.

But luckly charAt does return the correct characture
  • Loading branch information...
commit 34ab001a2833d4e41af454f184460883369d577f 1 parent f41d213
@3rd-Eden 3rd-Eden authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/parser.js
View
7 lib/parser.js
@@ -236,16 +236,17 @@
*/
parser.decodePayload = function (data) {
- if (data[0] == '\ufffd') {
+ // IE doesn't like data[i] for unicode chars, charAt works fine
+ if (data.charAt(0) == '\ufffd') {
var ret = [];
for (var i = 1, length = ''; i < data.length; i++) {
- if (data[i] == '\ufffd') {
+ if (data.charAt(i) == '\ufffd') {
ret.push(parser.decodePacket(data.substr(i + 1).substr(0, length)));
i += Number(length) + 1;
length = '';
} else {
- length += data[i];
+ length += data.charAt(i);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.