You are not logged in.
Pages: 1
I have declared table like
TMeterGroup = class (TSQLRecord)
private
fgroupID:RawUTF8;
fName:RawUTF8;
published
property groupID:RawUTF8 index 40 read fgroupID write fgroupID stored AS_UNIQUE;
property Name:RawUTF8 index 50 read fName write fName stored AS_UNIQUE;
end;
Saved one item into MSSQL
Then i am trying to read:
MeterGroup := TMeterGroup.CreateAndFillPrepare(ExtDatabase,'');
if MeterGroup.FillOne then
In that manner i can read proper cyrillic value in "Name"
Second test
J := ExtDatabase.RetrieveListJSON( TMeterGroup,'',[],'');
and my cyrilic value become something else.
What did i miss?. Help me please.
Offline
Which SynDB class/unit are you using?
But CreateAndFillPrepare calls internally RetrieveListJSON, so I guess you may be making some confusion about charsets and encoding of strings.
RawUTF8 contains Unicode, but UTF-8 encoded, so you need to use UTF8ToString() to retrieve some VCL-compatible content.
Offline
Thank you for advice.
J := ExtDatabase.RetrieveListJSON( TMeterGroup,'',[],'');
s:=UTF8ToString(J);
works as i wanted to.
I am using
MSDBProps:=TOleDBMSSQL2012ConnectionProperties.Create(
...
VirtualTableExternalRegister(aModel,TMeterGroup,MSDBProps,'');
ExtDatabase:=TSQLRestServerDB.Create(aModel,':memory:');
Last edited by Quorren (2018-04-17 16:46:43)
Offline
Pages: 1