[Lazarus] Mac (or other BigEndian machine) users needed to test new Utf8StringOfChar code
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Mon Sep 16 18:47:44 CEST 2013
Bart schrieb:
> Hi,
>
> Current code for Utf8StringOfChar that I wrote (in LazUtf8 unit) may
> fail due to Utf8 -> UTF16 -> FillWord -> Utf8 conversions, which only
> work for UCS2, as Mattias pointed out to me.
>
> I constructed a new Utf8StringOfChar function that builds UTF8 without
> conversions.
> For speed reasons it uses FillWord or FillDWord when appropriate.
Did you also test the simpler approach, replicating the pattern in one
loop? It's independent of endianness, and can boil down to a single
machine instruction (x86: REP MOVS).
DoDi
More information about the Lazarus
mailing list