mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 21:20:24 +02:00
* Return delphi-compatible output for TValue.ToString when empty
This commit is contained in:
parent
cbc938900f
commit
9c5bfbeb78
@ -3984,6 +3984,8 @@ end;
|
|||||||
|
|
||||||
function TValue.ToString: String;
|
function TValue.ToString: String;
|
||||||
begin
|
begin
|
||||||
|
if IsEmpty then
|
||||||
|
Exit('(empty)');
|
||||||
case Kind of
|
case Kind of
|
||||||
tkWString,
|
tkWString,
|
||||||
tkUString : result := AsUnicodeString;
|
tkUString : result := AsUnicodeString;
|
||||||
@ -4000,7 +4002,7 @@ begin
|
|||||||
tkChar: Result := AnsiChar(FData.FAsUByte);
|
tkChar: Result := AnsiChar(FData.FAsUByte);
|
||||||
tkWChar: Result := UTF8Encode(WideChar(FData.FAsUWord));
|
tkWChar: Result := UTF8Encode(WideChar(FData.FAsUWord));
|
||||||
else
|
else
|
||||||
result := '';
|
result := '<unknown kind>';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user