Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-11

Use widesting as default?

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Birger Jansen

Hi all,

I'm converting a Delphi 2009 project to FPC. In this project all strings are widestrings, which is default for Delphi 2009. However, in FPC all strings are still 'normal' strings. Is there a way (compiler switch?) to use widestring as default for all strings in FPC?

Kind regards,
Birger Jansen

(I'm not sure if this message should go here or to Lazarus list since it is not entirely clear to me if strings belong to FPC or Lazarus. Forgive me if this is the wrong list!)

Reply by email

Paul Ishenin
to Birger Jansen
Birger Jansen wrote
Hi all, I'm converting a Delphi 2009 project to FPC. In this project all strings are widestrings, which is default for Delphi 2009. However, in FPC all strings are still 'normal' strings. Is there a way (compiler switch?) to use widestring as default for all strings in FPC?

Yes. Checkout cpstrnew branch and complete missing things.

Best regards,
Paul Ishenin.

Reply by email

Jonas Maebe
to Birger Jansen: I'm converting a Delphi 2009 project to FPC. In this project all strings are widestrings,…
Birger Jansen wrote 5 lines
I'm converting a Delphi 2009 project to FPC. In this project all strings are widestrings, which is default for Delphi 2009. However, in FPC all strings are still 'normal' strings. Is there a way (compiler switch?) to use widestring as default for all strings in FPC?

Strings belong to FPC, so this is the right list (fpc-pascal would be slightly more appropriate, but that doesn't matter). That said, FPC does not have such an option at this time.

Keep in mind that Delphi 2009's default string type is much more than a regular widestring. Using "unicodestring" instead in FPC would be more correct, but even then you won't have the same support yet (that first requires the completion of the cpstrnew branch, as Paul indicated).

Jonas

Reply by email

Birger Jansen
to Jonas Maebe
Show quoted text 5 lines
Keep in mind that Delphi 2009's default string type is much more than a regular widestring. Using "unicodestring" instead in FPC would be more correct, but even then you won't have the same support yet (that first requires the completion of the cpstrnew branch, as Paul indicated).

Thanks for the answer, Paul and Jonas. I'll check how cpstrnew works for me. Although I'm not sure if I have enough knowledge to actually contribute something in these deeper parts of the FPC-dungeon, I will report my findings.

Kind regards,
Birger Jansen

Reply by email