On Sat, 22 Nov 2014 16:18:09 +0100 Jürgen Hestermann <[email protected]> wrote:
> Am 2014-11-22 um 15:06 schrieb Mattias Gaertner: > > procedure TForm1.FormCreate(Sender: TObject); > > var s: string; // String = AnsiString because of $H+ > > begin > > s:=GetCommandLineW; > > // GetCommandLineW returns a UTF-16 PWideChar > > // the compiler adds code to convert this to the > > // default system codepage (CP_ACP = CP_UTF8) > > // the resulting string has StringCodePage CP_ACP > > // and is encoded in UTF-8. > > // therefore you can simply use it with the LCL > > Okay. > Does that mean that the compiler *always* assumes that > String=UTF-8 encoded AnsiString Yes, with the UTF8 RTL. The default RTL uses system codepage. > and converts to other (known) encoded string types if needed? Yes. That's the new feature of FPC 2.7.1. What other encoded string types do you have in mind? Mattias -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
