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

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Apr 16 10:47:45 CEST 2016

On Fri, 15 Apr 2016 10:19:06 +0200
Michael Schnell <mschnell at lumino.de> wrote:

> On 04/15/2016 08:35 AM, Michael Van Canneyt wrote:
> >
> > For string constants there are slightly different rules. There the 
> > result depends on the {$codepage} directive of the source file.
> Hmmm.
> If not setting $codepage Ifor a constant string I get StringCodePage = 0,
> If setting {$codepage UTF8} for a constant string I get StringCodePage = 
> 1200 which is UTF16.
> The program does work decently, anyway.
> And ASM stepping shows that no conversion is done.

That's correct. String literals in a codepage other than system are
stored as UTF-16 in the binary and converted on assign. The conversion
happens at runtime, so the string codepage is decided at


More information about the fpc-pascal mailing list