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


--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to