[Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

Mattias Gaertner nc-gaertnma at netcologne.de
Wed May 3 13:43:20 CEST 2017


On Wed, 3 May 2017 12:03:41 +0300
Juha Manninen via Lazarus <lazarus at lists.lazarus-ide.org> wrote:

>[...]
> Please also look at program LazUnicodeTest in components/lazutils/test/.
> It does advanced Unicode stuff and works in both Delphi and Lazarus.

I tried it:

First it did not compile in Delphi, because of an unsupported inline. I
fix that with an IFDEF FPC.

Then it runs. The output is somewhat hard to interpret as the
Windows console shows many chars as '?' and the writelns do not
explain what it is supposed to show. 
The good news is that it works.

The bad news is, that it only works because Delphi silently altered
the source file and added the BOM.

Back in Lazarus compiling such a file gives the error:
LazUnicodeTest.lpr(28,10) Error: UTF-8 code greater than 65535 found


> It means any code dealing with Unicode can do it.
> 
> How could this thing be communicated so that people understand?
> Why other Lazarus developers don't want to mention it?
> I am puzzled. :(

You are right, that using Unicode with Lazarus only needs a couple of
rules to follow. Sharing code with Delphi adds a few more rules.

Mattias


More information about the Lazarus mailing list