[fpc-devel] TStringList.LoadFromFile and SavetoFile - file encoding support

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Feb 3 09:59:00 CET 2009

On Tue, Feb 3, 2009 at 10:44 AM, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:
>> This is why many editors and mail programs have a menu option
>> 'Encoding': because they also don't know, and they cannot know
>> without external means, what the encoding is.
> Let's add that to TMemo. ;)

The point is that you will probably have a File Open dialog that gives
the filename to TMemo.LoadFromFile. The the file dialog could collect
the filename and optional encoding to pass on to LoadFromFile.

Even if TStringList has the optional encoding parameter, prior source
code should still work as-is without the encoding parameter. No code
would be broken.

I agree with Marco that auto detecting encodings is probably not a
good idea in the RTL, but at least enable the option of a encoding
parameter in TStringList, which could help things along. As in the
case of the bug report.

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the fpc-devel mailing list