drama22
asked on
indy Tmemory stream non latin charcter issue
i am using following code to send text data that saved inside memory stream
its sends text data correctly if its in english
but if its in other language like arabic it comes questions marks like this "?????" what could be the issue ?
here is how i add text to memory stream
MS := TMemoryStream(OutboundCmds.Objects[I]);
if MS <> nil then
begin
AContext.Connection.IOHandler.LargeStream := true;
AContext.Connection.IOHandler.Write(MS, 0, true);
end;
end;
its sends text data correctly if its in english
but if its in other language like arabic it comes questions marks like this "?????" what could be the issue ?
here is how i add text to memory stream
procedure TConnection.sendData;
var
I: integer;
SL: TStringList;
MS: TMemoryStream;
begin
MS := TMemoryStream.Create;
try
SL := TStringList.Create;
try
begin
SL.Add('مرحبا');
end;
if (SL.Count > 0) then
begin
SL.SaveToStream(MS);
MS.Position := 0;
end;
finally
SL.Free;
end;
finally
MS.Free;
end;
end;
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.