Skip to content

Commit 53fd767

Browse files
committed
Update utf8_encode.js
1 parent fe02c9c commit 53fd767

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

functions/xml/utf8_encode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ function utf8_encode (argString) {
3535
(c1 >> 6) | 192,
3636
( c1 & 63) | 128
3737
);
38-
} else if (c1 & 0xF800 != 0xD800) {
38+
} else if ((c1 & 0xF800) != 0xD800) {
3939
enc = String.fromCharCode(
4040
(c1 >> 12) | 224,
4141
((c1 >> 6) & 63) | 128,
4242
( c1 & 63) | 128
4343
);
4444
} else { // surrogate pairs
45-
if (c1 & 0xFC00 != 0xD800) { throw new RangeError("Unmatched trail surrogate at " + n); }
45+
if ((c1 & 0xFC00) != 0xD800) { throw new RangeError("Unmatched trail surrogate at " + n); }
4646
var c2 = string.charCodeAt(++n);
47-
if (c2 & 0xFC00 != 0xDC00) { throw new RangeError("Unmatched lead surrogate at " + (n-1)); }
47+
if ((c2 & 0xFC00) != 0xDC00) { throw new RangeError("Unmatched lead surrogate at " + (n-1)); }
4848
c1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000;
4949
enc = String.fromCharCode(
5050
(c1 >> 18) | 240,

0 commit comments

Comments
 (0)