Skip to content

Commit

Permalink
Update lib/byte-utils.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg authored Sep 12, 2023
1 parent ed3938c commit 373c708
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/byte-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ function utf8ToBytes (str) {
out[p++] = (c >> 6) | 192
out[p++] = (c & 63) | 128
} else if (
((c & 0xFC00) == 0xD800) && (i + 1) < str.length &&
((str.charCodeAt(i + 1) & 0xFC00) == 0xDC00)) {
((c & 0xFC00) === 0xD800) && (i + 1) < str.length &&
((str.charCodeAt(i + 1) & 0xFC00) === 0xDC00)) {
// Surrogate Pair
c = 0x10000 + ((c & 0x03FF) << 10) + (str.charCodeAt(++i) & 0x03FF)
out[p++] = (c >> 18) | 240
Expand Down

0 comments on commit 373c708

Please sign in to comment.