Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

LogDataset


#1

Im try to use this method for TAdoDataset.
But in console i can see wrong data in unicode fields. Im save dataset on disk with SaveToFile method with pfXML option and data file seems fine.
Grid in console not support unocode?


#2

Hello,

Thanks for reporting this issue.

[quote]But in console i can see wrong data in unicode fields. Im save dataset on disk with SaveToFile method with pfXML option and data file seems fine.
Grid in console not support unocode?[/quote]

The grid actually supports Unicode, so does normally the LogDataSet method. I will try to reproduce the described behavior here. It would be great if you could give me some additional information about this issue:

  • Which Delphi version are you using?
  • What do you mean with wrong data? Are the Unicode characters converted to the non-Unicode equivalents (if possible) or are they displayed as rectangles in the grid control?

Thanks!


#3

I just tried it with Delphi 2007 and it works fine. Here’s a test screenshot:

If i recall correctly, Delphi introduced Unicode support in its database layer with Delphi 2006.


#4

im using D7(+TntControls) and Ado.
May be problem in D7?
In adodataset i can see unicode(with tntcontrols and save content to xml file on disk), but after LogDataSet unicode is lost.


#5

Thanks for the update. Yes, I think this is a problem with Delphi 7. As already mentioned in the post above, I think that Delphi 2006 (or maybe 2005) was the first Delphi version which had full Unicode support in its database layer. I will look into it and test it with Delphi 7.


#6

I’ve taken a look at the dataset API supported by Delphi 7 and its Unicode support is very limited. For instance, to read a Unicode string from a TField, we are using the AsWideString method which was introduced with Delphi 2005 or Delphi 2006 and is not available in Delphi 7.

I’m not sure why the Unicode data is correctly displayed when you are using the SaveToFile method. However, as a workaround, instead of using the LogDataSet method, you could also write the dataset to the XML file and then log this file with the LogSourceFile method and the siXml parameter.