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 3144906 commit a4209a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plutoscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ const utf32_to_utf8 = function(utf8/*: array */, utf32/*: number */)/*: void */
const utf16_to_utf8 = function(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 a4209a2

Please sign in to comment.