On Thu, 04 Dec 2014 16:06:48 +0100 Hans-Peter Diettrich <drdiettri...@aol.com> wrote:
>[...] Mattias Gaertner schrieb: > > On Thu, 04 Dec 2014 07:00:59 +0100 > > Hans-Peter Diettrich <drdiettri...@aol.com> wrote: > > > UTF8Console is needed, when your source is UTF-8, but the compiler > > thinks it is Windows CP. UTF8Console is defined in LazUTF8. > > An alternative is UTF8Decode. > > Thanks :-) > > >> Just tested on WinXP: > >> > >> program test; > >> var a: AnsiString; > >> begin > >> a := 'äöü'; > >> WriteLn(a,'äöü'); > >> end; > >> > >> works differently with file encoding Ansi, UTF-8 and UTF-8bom. The > >> latter correctly shows 'äöüäöü', else a mix of several encodings shows > >> up in the console. > > > > I see. > > Only after testing the string encodings I found out that $codepage does > not affect CP_ACP, this was unclear to me before. A new Lazarus version > instead may try to set DefaultSystemCodePage to UTF-8, in order to > preserve compatibility with the current assumption about UTF-8 encoding > with AnsiStrings. Yes, this fixes many problems. OTOH it create some new (e.g. ThousandSeparator). > > Indeed I never tried passing a constant in writeln. > > You never wrote text or separtors? I meant my tests with fpc 2.7.1. ;) > > Does Delphi also pass constants unconverted to writeln? > > Delphi does not convert anything in console output, the user must > convert everything to CP_OEM :-( Same as fpc 2.6.4. What function do Delphians use? Mattias -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus