On Tue, 02 Dec 2014 04:05:59 +0100 Hans-Peter Diettrich <drdiettri...@aol.com> wrote:
>[...] > BTW it's nice that FPC console Write/Ln (mostly) converts AnsiStrings to > the console codepage, while Delphi (XE) doesn't convert :-) +1 Although it confuses people who don't know about "console codepage" (OEM codepage). > But I found a somewhat strange result with generic String variables, > tested with: > > var A: AnsiString; S: String; > begin > S := ' äöü'; > A := S; > //S := A; //changes nothing > WriteLn('A CP: ',StringCodePage(A), A); //always shows ' äöü' > WriteLn('S CP: ',StringCodePage(S), S); //letters differ > end. What codepage is the source file? Many things affect string literals. Source codepage, system codepage, string type, defaultsystemcodepage, library, compiler version. I started a table for UTF-8 literals: http://wiki.lazarus.freepascal.org/Character_and_string_types#String_constants Mattias _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel