Title: Simple DB Client/Server Scenario with Arabic Characters Post by: mulhams on March 12, 2017, 10:00:57 AM I'm taking my very first steps with RTC. I was following the articles in the classroom for database Server/Client access. I managed to make everything work fine but the Arabic characters in my SQL Server don't show up correctly in the grid (they show up as '????'). Am I missing something here? I'm using UniDAC components.
Thanks. Title: Re: Simple DB Client/Server Scenario with Arabic Characters Post by: D.Tkalcec (RTC) on March 12, 2017, 11:06:44 AM Even though functions from the "rtcDB" unit (which are provided out-of-the-box) for copying data to and from TDataSet descendants make things easier in the beginning and should work for most field types, these functions can NOT automatically recognize and translate all field types provided by all Database Access components. This is especially true for fields containing Unicode text and binary data.
To correctly extract your data from a TDataSet descendant component and copy that data to a TRtcDataSet component, you should copy the "DelphiDataSetToRtc" function implementation from the "rtcDB" unit into one of your own units, give it a different name and modify your version to correctly copy all DB Field types you are using with Database Access components of your choice. Also, while using the "Value" property on RTC Value objects should work for the most common data types, in case your data is stored in a special format or encoded in a certain way, you have to read the contents by using the same format used while storing it and decode it after reading - if necessary. For example, the "TRtcDataSet" class use the "asText" property for storing and transporting Unicode strings, while the "asString" property only stores and sends the lower 8-bits of each character, so make sure to use "asText" with Unicode strings on both sides (Client and Server) instead of "asString" - if the Database access components you are working with have full Unicode support. Best Regards, Danijel Tkalcec |