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

Michael Schnell mschnell at lumino.de
Tue Apr 19 10:22:40 CEST 2016


On 04/19/2016 08:22 AM, Jonas Maebe wrote:
> When any {$codepage xxx} directive is specified, string constants in 
> the source are represented in a way that makes lossless conversion to 
> any other code page possible. This conversion to the target code page 
> is performed at compile time where possible (when the target code page 
> cannot change at run time), and otherwise at run time.
>
Of course I do understand that.

But anyway, AFAIK, UTF8 already is a way of lossless coding, so I don't 
see a forcing necessity to convert that to UTF16 at compile time. And as 
far as I understand, if the user does not take some means, the 
executable will work with 8 bit coding and very likely with UTF8, so 
holding the constants as UTF16 increases as well memory as CPU resource 
usage.

(I am not trying to bash anybody ! It obviously does work nicely and 
supposedly close to always as expected, and the possible resource 
overhead will be extremely rare and minimal).

-Michael



More information about the fpc-pascal mailing list