[fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

Michael Schnell mschnell at lumino.de
Thu Apr 14 10:16:21 CEST 2016


On 04/14/2016 08:52 AM, Michael Van Canneyt wrote:
> The default encoding for the string type is determined at run-time, 
> not at compile time.
>
How can that work for string constants ? Will they in fact (virtually) 
change their encoding when DefaultSystemcodepage is different  ?

For a test I did   result := StringCodePage('äü');

This results in a 0 which is CP_ACP, which is supposed to mean "in fact 
its the value of DefaultSystemcodepage", which in my test in Linux is  
65001 which means UTF8.

Of course in this test it's correct. But if I start the executable in a 
system that imposes another value of DefaultSystemcodepage or if it is 
compiled in a way that results in the constant strings to be coded in 
another way than 65001, what will I see  ? (Right now I don't have a 
Lazarus installation on Windows at hand).

-Michael



More information about the fpc-pascal mailing list