Face some problem with RtcString() with
? character.
Retrieve data from both AS400 and SQL Server via AnyDAC, string field return and display correcly in Thai characters.
Passing that data via RTC using DelphiDataSetToRTC and DelphiRowToRTC from rtcDB unit, all Thai characters display with
? characters.
After some investigate, I recognize some code in both procedure with comment in about:-
rtc_text: rtcDS.asText[fldname]:= field.AsWideString;
After comment this line out, data is display properly.
Seem that it's about converting string fields between DataSet and RTC. I go through document and some code in rtcInfo to find out about rtc_string type but a bit confuse.
In rtcDefs.inc had this 2 line defined as default
{.$DEFINE FORCE_ANSI_STRING} // set type RtcString = AnsiString ?
{.$DEFINE FORCE_WIDE_STRING} // set type RtcString = WideString ?
This mean that RtcString = String, am I correct. If so while the code
rtc_string: rtcDS.asString[fldname]:= RtcString(field.AsString);
is fail to convert., or database I connected return with AnsiString. If so, do I need to add more line of code to verify the return type from dataset as AnSiString.
Could you give me more explanation about rtc_string on this case.
I tested on RTC 605 on windows 7
Thank you and Regards,
P.S. I did more test after this on my own server with SQL Express default setup, everything when fine with out any modification in rtcDB.