fcl-web: better error message conversion

This commit is contained in:
mattias 2024-01-31 10:24:40 +01:00
parent f29156340a
commit 0a0f213b8b

View File

@ -1645,13 +1645,13 @@ begin
ErrMsg:=IntToStr(Err);
if woSendErrClosesConn in Options then
begin
if CP_ACP=CP_UTF8 then begin
SetLength(Data, length(ErrMsg));
Move(ErrMsg[1],Data[0],length(Data));
end else begin
SetLength(Data, 0);
Data.Append(TEncoding.UTF8.GetBytes(UnicodeString(ErrMsg)));
end;
{$IF SIZEOF(CHAR)=2}
SetLength(Data, 0);
Data.Append(TEncoding.UTF8.GetBytes(UnicodeString(ErrMsg)));
{$ELSE}
SetLength(Data, length(ErrMsg));
Move(ErrMsg[1],Data[0],length(Data));
{$ENDIF}
DispatchEvent(ftClose, nil, Data);
end
else