On Mon, Dec 27, 2021 at 1:44 AM Noel Duffy via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> I need some help getting to the root of a problem with incorrect results
> on Apple hardware (M1, aarch64) for the function UTF8LengthFast in lazutf8.
>
> On MacOS, when given a string containing one or more UTF8 characters,
> UTF8LengthFast returns wildly incorrect results. On Fedora, the function
> returns the correct answer.
>

You mean both MacOS and Fedora run on the same aarch64 CPU?
It must be a Big endian / Little endian issue. IIRC it can be adjusted in
ARM CPUs.
Why do MacOS and Linux use a different setting there? I have no idea.

If somebody can figure out how to port the function, good.
Otherwise we can make UTF8LengthFast call the standard UTF8Length using an
IFDEF when needed. What is the correct define then?

Juha
-- 
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to