SdfDataset, FirstLineAsSchema and converting CharacterSet lazarus / 16-Databases ---------------------------------------------------------------------- tintinux · 2011-01-24 16:20 Hi I happen to read delimited files in a DbGrid, and they can be in a character set to convert in UTF-8 before display. I handle this by assigning an OnGetText event on every string field of the schema, performing the appropriate conversion. This works perfectly, excepted when FirstLineAsSchema is true : titles are not processed by OnGetText and not displayed properly when they contain specific characters. How could I convert the titles ? May be, the TSdfDataSet component could be changed to call OnGetText on the first line when assigned. But I'm not sure this would be easy and fine... Or someone see a workaround ? Thanks for your ideas ! Regards Tintinux ---------------------------------------------------------------------- howardpc · 2011-01-24 18:17 Could you not convert the file to UTF-8 on disk, so the first line is already in the correct format for display when it is later accessed by the SDFDataset when it parses the first line? Howard ---------------------------------------------------------------------- tintinux · 2011-01-27 08:40 Hi Yes this is a solution, but I had hope to find a lighter one. The files are sometimes heavy (60000 lines of accounting moves recently) and this will not be very quick to decode the entire file to change only the first line. Regards Tintinux