Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-19 Thread Marcos Douglas
On Sat, Aug 18, 2012 at 7:30 PM, Graeme Geldenhuys wrote: > Hi > > On 18 August 2012 22:44, Jonas Maebe wrote: >> The mode is called "delphiunicode" and in Delphi unicode versions, string = >> unicodestring. > > Not to get this thread into one of those heated unicode discussions > again, but cou

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-19 Thread Jürgen Hestermann
Am 2012-08-18 22:33, schrieb Sven Barth: > The RTL mostly uses PChar to not be restricted to 255 characters (exceptions are ancient compatibility units like DOS, Objects, etc.). > There are often overloads for ShortString and AnsiString though. AFAIK all file handling routines use the file recor

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Graeme Geldenhuys
Hi, On 18 August 2012 22:50, Jonas Maebe wrote: > If you don't want this code page behaviour anyway, you can use the following > > {$mode delphiunicode} > {$modeswitch systemcodepage-} OK, I think I got my final answer on this FPC is definitely not ready to port any Delphi 2009+ projects. I

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Graeme Geldenhuys
Hi On 18 August 2012 22:44, Jonas Maebe wrote: > The mode is called "delphiunicode" and in Delphi unicode versions, string = > unicodestring. Not to get this thread into one of those heated unicode discussions again, but couldn't FPC at least do one better that Delphi. "Unicode" means a string

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Graeme Geldenhuys
On 18 August 2012 21:33, Sven Barth wrote: > "String" can mean either "ShortString", "AnsiString" or "UnicodeString" > depending on the compiler settings: > > Non-Delphi modes and $H- (default): ShortString > Delphi mode: AnsiString > DelphiUnicode mode: UnicodeString > Non-Delphi modes and $H+: A

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Jonas Maebe
On 18 Aug 2012, at 22:22, Sven Barth wrote: > E.g. consider the following example: > > {$mode delphiunicode} > > type > TMyStringList = class(TStringList) >function Add(const aText: String): Integer; override; > end; > > This will currently give a compile error, because TStringList is co

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Jonas Maebe
On 18 Aug 2012, at 21:29, Graeme Geldenhuys wrote: > On 18 August 2012 16:11, Jonas Maebe wrote: >> Only in {$mode delphiunicode} (which is what you should use if you want to >> compile code written for a Delphi version in which string=unicodestring). > > I've enabled that new compiler mode...

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Jonas Maebe
On 18 Aug 2012, at 21:20, Graeme Geldenhuys wrote: > Wasn't there lots of "votes" from many that string is UTF-8 encode > under Linux, Unix, MacOSX, and UTF-16 under Windows? The mode is called "delphiunicode" and in Delphi unicode versions, string = unicodestring. Maybe one day another mode or

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Sven Barth
On 18.08.2012 16:15, Jürgen Hestermann wrote: The few things I know about are: Am 2012-08-18 15:54, schrieb Graeme Geldenhuys: 1) Is it correct that String <> AnsiString any more? Well, it never was. At least "string" could also be a shortstring, maybe other strings too meanwhile (I don't kn

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Sven Barth
On 18.08.2012 21:20, Graeme Geldenhuys wrote: Hi, On 18 August 2012 16:11, Jonas Maebe wrote: 1) Is it correct that String <> AnsiString any more? Only in {$mode delphiunicode} (which is what you should use if you want to compile code written for a Delphi version in which string=unicodestr

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Sven Barth
On 18.08.2012 17:48, Ludo Brands wrote: Only in {$mode delphiunicode} (which is what you should use if you want to compile code written for a Delphi version in which string=unicodestring). Is this hidden gem announced or documented somewhere? Is there a -M compiler switch to set it as default

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Graeme Geldenhuys
On 18 August 2012 16:11, Jonas Maebe wrote: >> 1) Is it correct that String <> AnsiString any more? > > > Only in {$mode delphiunicode} (which is what you should use if you want to > compile code written for a Delphi version in which string=unicodestring). I've enabled that new compiler mode...

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Graeme Geldenhuys
Hi, On 18 August 2012 16:11, Jonas Maebe wrote: > >> 1) Is it correct that String <> AnsiString any more? > > Only in {$mode delphiunicode} (which is what you should use if you want to > compile code written for a Delphi version in which string=unicodestring). OK, that would help. I'll try that

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Ludo Brands
> Only in {$mode delphiunicode} (which is what you should use if you > want to compile code written for a Delphi version in which > string=unicodestring). > Is this hidden gem announced or documented somewhere? Is there a -M compiler switch to set it as default language mode? FPC doesn't list

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Jonas Maebe
Graeme Geldenhuys wrote on za, 18 aug 2012: 1) Is it correct that String <> AnsiString any more? Only in {$mode delphiunicode} (which is what you should use if you want to compile code written for a Delphi version in which string=unicodestring). 2) If true, what is String an alias of?

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Graeme Geldenhuys
Hi, On 18 August 2012 15:15, Jürgen Hestermann wrote: > >> 1) Is it correct that String <> AnsiString any more? > > Well, it never was. At least "string" could also be a shortstring, maybe > other strings too meanwhile (I don't know). I guess I was a bit vague. All projects I work on and see the

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Graeme Geldenhuys
Hi, On 18 August 2012 15:05, Marco van de Voort wrote: > > If it relies heavily on unicodestring, IMHO yes. Well, there is a clear distinction being made between AnsiString and String in many classes. For example: TtiCompressAbs = class(TObject) public function CompressString

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Jürgen Hestermann
The few things I know about are: Am 2012-08-18 15:54, schrieb Graeme Geldenhuys: 1) Is it correct that String <> AnsiString any more? Well, it never was. At least "string" could also be a shortstring, maybe other strings too meanwhile (I don't know). 3) If false, what must I enable/toggl

Re: [fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: > 0) Am I jumping the gun here, and FPC is not nearly compatible enough to > port a Delphi 2010, XE, XE2 project to FPC 2.7.1? If it relies heavily on unicodestring, IMHO yes. My guess is that you mistook a comment that confirmed the base impleme

[fpc-pascal] FPC vs Delphi's unicode string support questions

2012-08-18 Thread Graeme Geldenhuys
Hi, In the tiOPF project the v3 branch is a Delphi Unicode String enabled version of tiOPF, thus it only supports Delphi 2009/2010 and newer. A while back I had some discussion with Michael van Canneyt, and he believes FPC is sufficiently compatible to Delphi 2010 and later, so the tiOPF3 por