Re: [fpc-devel] Delphi incompatible encoding

2014-12-02 Thread Tomas Hajny
On Tue, December 2, 2014 08:31, Hans-Peter Diettrich wrote: Jonas Maebe schrieb: To get behaviour that is compatible with Delphi2009+, compile with -Mdelphiunicode or {$modeswitch delphiunicode}. Do you mean {$mode delphiunicode}? Now I wonder about compilation at all. When I compile a

Re: [fpc-devel] Delphi incompatible encoding

2014-12-02 Thread Hans-Peter Diettrich
Tomas Hajny schrieb: On Tue, December 2, 2014 08:31, Hans-Peter Diettrich wrote: When I compile a console program on the commandline, most strings are readable in the console (see previous answer). But when I compile using Lazarus, all strings (including UnicodeString!) are shown in

Re: [fpc-devel] Delphi incompatible encoding

2014-12-02 Thread Hans-Peter Diettrich
Mattias Gaertner schrieb: On Tue, 02 Dec 2014 04:05:59 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: Many things affect string literals. Source codepage, system codepage, string type, defaultsystemcodepage, library, compiler version. I started a table for UTF-8 literals:

Re: [fpc-devel] Delphi incompatible encoding

2014-12-02 Thread Mattias Gaertner
On Tue, 02 Dec 2014 11:32:13 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: Mattias Gaertner schrieb: On Tue, 02 Dec 2014 04:05:59 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: Many things affect string literals. Source codepage, system codepage, string type,

Re: [fpc-devel] Delphi incompatible encoding

2014-12-01 Thread Sven Barth
Am 01.12.2014 10:33 schrieb Hans-Peter Diettrich drdiettri...@aol.com: Another one: Delphi XE does not export the CP_xxx encoding constants from System.pas. This means that the encoding constants are not available in (compatible) user code. It's not the first and likely not the last we export

Re: [fpc-devel] Delphi incompatible encoding

2014-12-01 Thread Jonas Maebe
Hans-Peter Diettrich wrote on ma, 01 dec 2014: Now I could compile FPC 2.7.1 and perform some tests :-) Unfortunately I couldn't submit an bug report, so it comes here: When compiled with Delphi XE, the code below shows 1252 (my DefaultSystemCodePage) for all strings, be empty or non-empty.

Re: [fpc-devel] Delphi incompatible encoding

2014-12-01 Thread Jonas Maebe
Hans-Peter Diettrich wrote on ma, 01 dec 2014: program rawtest; var s: AnsiString; //UTF8String; r: RawByteString; begin s := 'abc'; r := s; WriteLn('s CP: ',StringCodePage(s)); //1252 I forgot to mention that the above also prints 0 in FPC if you don't compile in mode

Re: [fpc-devel] Delphi incompatible encoding

2014-12-01 Thread Hans-Peter Diettrich
Sven Barth schrieb: Am 01.12.2014 10:33 schrieb Hans-Peter Diettrich drdiettri...@aol.com mailto:drdiettri...@aol.com: Another one: Delphi XE does not export the CP_xxx encoding constants from System.pas. This means that the encoding constants are not available in (compatible) user code.

Re: [fpc-devel] Delphi incompatible encoding

2014-12-01 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: Hans-Peter Diettrich wrote on ma, 01 dec 2014: To get behaviour that is compatible with Delphi2009+, compile with -Mdelphiunicode or {$modeswitch delphiunicode}. The compiler option (-M) works, but the $modeswitch is not accepted by the compiler (2.7.1): Illegal

Re: [fpc-devel] Delphi incompatible encoding

2014-12-01 Thread Sven Barth
On 02.12.2014 00:01, Hans-Peter Diettrich wrote: Sven Barth schrieb: Am 01.12.2014 10:33 schrieb Hans-Peter Diettrich drdiettri...@aol.com mailto:drdiettri...@aol.com: Another one: Delphi XE does not export the CP_xxx encoding constants from System.pas. This means that the encoding