[Lazarus] UTF8 RTL for Windows

Jürgen Hestermann juergen.hestermann at gmx.de
Sat Nov 22 16:18:09 CET 2014


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 and converts to
other (known) encoded string types if needed?






More information about the Lazarus mailing list