You are not logged in.
Pages: 1
Hi,
I'm trying Mormot in a rest service context. The entry sends the result as stream.
I'm using
<Code>
...
Props := TSQLDBFireDACConnectionProperties.Create('MSSQL?Server=' + lsServerName ,lsDatabaseName,lsUserName,lsPassword);
...
try
Conn := Props.NewConnection;
try
Conn.Connect;
Query := Conn.NewStatement;
try
lpoS := TMemoryStream.Create;
Query.Execute(lsSql,true,[]);
Query.FetchAllToJSON(lpoS,true);
Result := lpoS;
finally
Query.Free;
end;
finally
Conn.Free;
end;
finally
Props.Free;
end;
</Code>
The result is fine except for french accents :
{"RefValueId":8000000000050100062,"Label":"Négociateur GIE AC"},{"RefValueId":8000000000050100063,"Label":"Négociateur GIE AEC"}
Is there something to do to force character encoding ?
Database server is SQL Server 2012
Columns in database table are NVARCHAR(xx)
IDE is Delphi 10.3.3
Regards,
JM
Last edited by halted (2019-12-18 17:39:49)
Offline
Yes the Content-Encoding header was missing in the respose build by the server.
Many thanks for this awesome work !
Offline
Pages: 1