[Lazarus] TStringList.LoadFromFile encoding parameter

Michael Schnell mschnell at lumino.de
Mon Jul 11 12:50:18 CEST 2016


On 07/11/2016 10:29 AM, Michael Van Canneyt wrote:
>
> There is no 'hard coded UTF8' stringlist.
>
> This is an assumption made by Lazarus LCL, which - depending on the 
> version
> of FPC - sets the default single-byte string codepage to UTF8.
>
> TStringList is not part of Lazarus, and hence must cater for other 
> codepages
> as well.

Of Course I do know all this and this is exactly what I tried to point out.

In fact TStringList (fpc) is hard coded to 8 Bit, and hence can hold any 
8 bit encoding, including UTF-8 and the German ANSI Variant used for the 
file I try to load. and it does not do any conversion at all.

Now Lazarus seems to set the compiler to by default handle strings as 
UTF-8 coded.

This obviously creates the said problem.

-Michael


More information about the Lazarus mailing list