[Lazarus] TStringList.LoadFromFile encoding parameter

Michael Van Canneyt michael at freepascal.org
Mon Jul 11 13:01:27 CEST 2016



On Mon, 11 Jul 2016, Michael Schnell wrote:

> 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.

Not the compiler, the RTL.

Michael.


More information about the Lazarus mailing list