|
@@ -1835,6 +1835,7 @@ end;
|
|
//One character US-ASCII, convert it to unicode
|
|
//One character US-ASCII, convert it to unicode
|
|
if IBYTE = 10 then
|
|
if IBYTE = 10 then
|
|
begin
|
|
begin
|
|
|
|
+(*
|
|
If (PreChar<>13) and FALSE then
|
|
If (PreChar<>13) and FALSE then
|
|
begin
|
|
begin
|
|
//Expand to crlf, conform UTF-8.
|
|
//Expand to crlf, conform UTF-8.
|
|
@@ -1855,6 +1856,7 @@ end;
|
|
end;
|
|
end;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
|
|
+*)
|
|
begin
|
|
begin
|
|
Dest[OutputUnicode]:=WideChar(IBYTE);
|
|
Dest[OutputUnicode]:=WideChar(IBYTE);
|
|
inc(OutputUnicode);
|
|
inc(OutputUnicode);
|
|
@@ -1978,6 +1980,7 @@ end;
|
|
//One character US-ASCII, convert it to unicode
|
|
//One character US-ASCII, convert it to unicode
|
|
if IBYTE = 10 then
|
|
if IBYTE = 10 then
|
|
begin
|
|
begin
|
|
|
|
+(*
|
|
if (PreChar<>13) and FALSE then
|
|
if (PreChar<>13) and FALSE then
|
|
begin
|
|
begin
|
|
//Expand to crlf, conform UTF-8.
|
|
//Expand to crlf, conform UTF-8.
|
|
@@ -1987,6 +1990,7 @@ end;
|
|
PreChar:=10;
|
|
PreChar:=10;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
|
|
+*)
|
|
begin
|
|
begin
|
|
inc(OutputUnicode);
|
|
inc(OutputUnicode);
|
|
PreChar:=IBYTE;
|
|
PreChar:=IBYTE;
|
|
@@ -2242,7 +2246,7 @@ function UCS4StringToUnicodeString(const s : UCS4String) : UnicodeString;
|
|
begin
|
|
begin
|
|
reslen:=0;
|
|
reslen:=0;
|
|
for i:=0 to length(s)-2 do { skip terminating #0 }
|
|
for i:=0 to length(s)-2 do { skip terminating #0 }
|
|
- Inc(reslen,1+ord((s[i]>$ffff) and (s[i]<=$10ffff)));
|
|
|
|
|
|
+ Inc(reslen,1+ord((s[i]>$ffff) and (cardinal(s[i])<=$10ffff)));
|
|
SetLength(result,reslen);
|
|
SetLength(result,reslen);
|
|
UCS4Decode(s,pointer(result));
|
|
UCS4Decode(s,pointer(result));
|
|
end;
|
|
end;
|
|
@@ -2255,7 +2259,7 @@ function UCS4StringToWideString(const s : UCS4String) : WideString;
|
|
begin
|
|
begin
|
|
reslen:=0;
|
|
reslen:=0;
|
|
for i:=0 to length(s)-2 do { skip terminating #0 }
|
|
for i:=0 to length(s)-2 do { skip terminating #0 }
|
|
- Inc(reslen,1+ord((s[i]>$ffff) and (s[i]<=$10ffff)));
|
|
|
|
|
|
+ Inc(reslen,1+ord((s[i]>$ffff) and (cardinal(s[i])<=$10ffff)));
|
|
SetLength(result,reslen);
|
|
SetLength(result,reslen);
|
|
UCS4Decode(s,pointer(result));
|
|
UCS4Decode(s,pointer(result));
|
|
end;
|
|
end;
|