Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Porting old Delphi2007 application using TServerSocket....
#20
(07-07-2020, 10:33 AM)BosseB Wrote: Re strings, I think FreePascal did not do what Delphi did and throw out the old string and replace with WideString still named string.

Delphi did not change the string type to WideString.  It changed to a new UnicodeString type.  WideString still exists as a separate type.

FreePascal does the exact same thing under {$mode DelphiUnicode} and {$modeswitch UnicodeStrings}, for Delphi compatibility.

(07-07-2020, 10:33 AM)BosseB Wrote: Instead FPC adheres to string = AnsiString as far as I know.

By default, yes.  However, under Lazarus, the default AnsiString encoding is actually set to UTF-8.  So they didn't strictly keep the original ANSI behavior of AnsiString, either.

(07-07-2020, 10:33 AM)BosseB Wrote: I will probably change the ported app such that the containers are declared AnsiString instead

Please don't!  AnsiString is simply not intended for non-textual data, and it WILL break binary data under Delphi 2009+'s AnsiString codepage handling, and under FreePascal/Lazarus' AnsiString UTF-8 handling.

(07-07-2020, 10:33 AM)BosseB Wrote: but generally I am switching to TBytes (or TIdBytes).

That is a good idea.

(07-07-2020, 10:33 AM)BosseB Wrote: But I am doing a lot of stuff on Raspberry Pi boxes these days and then FreePascal and Lazarus are what I use.

Are you aware that Delphi Android apps and Linux apps can run on Raspberry Pi?

Reply


Messages In This Thread
RE: Porting old Delphi2007 application using TServerSocket.... - by rlebeau - 09-21-2020, 06:31 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)