Skip to content

Commit

Permalink
Handle possibly malformed UTF-16
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Sep 29, 2024
1 parent 49220c2 commit 5e90eaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ function utf32_to_utf8(utf8/*: array */, utf32/*: number */)/*: void */
function utf16_to_utf8(str)
{
let arr = [];
for(let i = 0; i != str.length; ++i)
for(let i = 0; i < str.length; ++i)
{
let c = str.charCodeAt(i);
if ((c >> 10) == 0x36) // Surrogate pair?
Expand Down

0 comments on commit 5e90eaf

Please sign in to comment.