Michael Van Canneyt wrote 17 lines
On Thu, 5 Nov 2015, Marc Santhoff wrote:
> On Do, 2015-11-05 at 14:25 +0100, Marc Santhoff wrote:
>> On Mi, 2015-11-04 at 19:01 +0100, Marc Santhoff wrote:
>>> Hi,
>>>
>>> when trying to us a TSdfDataset connected to a TDatasource and a
>>> TDBGrid, only some unicode symbols are shown (those little squares
>>> holding four tiny numbers) for string data.
>>>
>>> The data files are encoded iso-8859 but I have found no switch for
>>> setting the encoding of TDataSource or TSdfDataset. When loading a
>>> TFileStream is used, but I did not find a property or method for
>>> changing the encoding on the fly in it, either.
>>>
>>> How can I fix it?
Got to ask some more questions ...
Show quoted text 5 lines
How would that easy solution look like?
From digging the code and thinking about it it is clear that my
implementation has to be inside TSdfDataset or a descendant. It cannot be done using a special file stream because of the byte count change with UTF8.
How can the current system encoding be retrieved in a platfrom neutral way?
Would it be OK to only stick any string into Ansi2utf8() and hand over the result in this case? Here I know the files encoding and it is fixed to iso8859-1, no change ever.
But a general solution would have a property storing the files encoding and a list of known encodings, do fpc/lazarus have knowledge of encodings somewhere?
Marc Santhoff