[Lazarus] Converting all code to use UnicodeString

Marcos Douglas B. Santos md at delfire.net
Mon Sep 25 20:32:32 CEST 2017


On Mon, Sep 25, 2017 at 3:19 PM, Ondrej Pokorny via Lazarus
<lazarus at lists.lazarus-ide.org> wrote:
> On 25.09.2017 20:02, Marcos Douglas B. Santos via Lazarus wrote:
>>
>> May I code using just "string"?
>
>
> Yes. LCL is ANSI/UTF8 only, so is TStrings.
>
> You can write Lazarus+Delphi compatible code without a lot of problems. Just
> use the string type. The only thing you have to be aware is that in Delphi
> you work with UTF-16 and in Lazarus with UTF-8 - but for most cases it
> doesn't really matter. You will have to write your own methods with IFDEF-ed
> code for things where it matters (read/write from/to buffer, char-by-char
> iterations etc.).

But my code had different outputs and/or warnings only using Lazarus!

You said compatible.
What about Warnings?
Why I need IFDEF-ed if the code "is" compatible?

For example, is this code compatible/work with/on Delphi?
https://github.com/mdbs99/james/blob/a9ad48fb8eaf4f11c6dd7b65d6ac2f63e6fc09fb/test/james.data.tests.pas#L57

Best regards,
Marcos Douglas


More information about the Lazarus mailing list