You are not logged in.
Today I update the mormot source for a project and I noticed that there is a character issue starting probably with commit 8338979 or one in the following 4-5 commits.
With the last changes I am getting the greek characters in form like ΑιτιολΟγιση Ξ³ΞΉΞ± ΞΌΞ·
The problem I noticed first has to do with Torm.GetJsonValues. Check the following source:
TOrmSoup=class(Torm)
private
Fplanttwo: rawutf8;
Fplantone: rawutf8;
published
property plantone:rawutf8 read Fplantone write Fplantone;
property planttwo:rawutf8 read Fplanttwo write Fplanttwo;
end;
procedure TForm3.Button1Click(Sender: TObject);
var o:tormsoup; s:rawutf8;
begin
o:=tormsoup.Create;
o.plantone:='Κρεμμύδι';
o.planttwo:='πατάτα';
s:=o.GetJsonValues(true,true,ALL_FIELDS);
end;
The result in s is now:
s='{"RowID":0,"plantone":"Ξ'#$9A'Ο'#$81'ΞµΞΌΞΌΟ'#$8D'δι","planttwo":"πατάτα"}'
Using JsontoObject instead of GetJsonValues does not produce this problem.
The reason I am using GetJsonValues (and not JsontoObject) is to have the possibility to select which fields I need to be exported to Json string.
Offline
I noticed that EnsureRawUtf8 fixes it. I will use it, not to cause trouble.
Offline
There was a code page issue on Delphi Unicode (only).
Please try with
https://github.com/synopse/mORMot2/commit/be77a417b
I have added explicit regression tests to fight against this issue in the future:
https://github.com/synopse/mORMot2/commit/8d60177d5
Offline
Many many thanks @ab
Offline