fcl-js: writer: fixed writing invalid UTF-16

git-svn-id: trunk@47829 -
This commit is contained in:
Mattias Gaertner 2020-12-21 15:48:48 +00:00
parent cbe352808a
commit 049af48bd8

View File

@ -611,10 +611,9 @@ begin
begin
inc(I,2); // surrogate, two char codepoint
continue;
end
else
// invalid UTF-16, cannot be encoded as UTF-8 -> encode as hex
R:=R+'\u'+TJSString(HexStr(ord(c),4));
end;
// invalid UTF-16, cannot be encoded as UTF-8 -> encode as hex
R:=R+'\u'+TJSString(HexStr(ord(S[i]),4));
end
else
// invalid UTF-16 at end of string, cannot be encoded as UTF-8 -> encode as hex