mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 13:30:33 +02:00
fcl-js: writer: fixed writing invalid UTF-16
git-svn-id: trunk@47829 -
This commit is contained in:
parent
cbe352808a
commit
049af48bd8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user