[fpc-pascal] UTF-8 versions of Copy() and Length()
Rimgaudas Laucius
rimga at ktl.mii.lt
Sat May 19 16:25:29 CEST 2007
----- Original Message -----
From: "Florian Klaempfl" <florian at freepascal.org>
To: "FPC-Pascal users discussions" <fpc-pascal at lists.freepascal.org>
Sent: Saturday, May 19, 2007 4:45 PM
Subject: Re: [fpc-pascal] UTF-8 versions of Copy() and Length()
> Graeme Geldenhuys schrieb:
>> On 5/19/07, Daniƫl Mantione <daniel.mantione at freepascal.org> wrote:
>>> > Does FPC have UTF-8 versions of the Copy() and Length() functions?
>>>
>>> They don't exist. FPC has been designed to either use the system
>>> encoding
>>> (which can be utf8). In this case, the string routines from sysutils do
>>> what you want. The other option is to use widestrings;
>>> length(utf8decode(s)) will return the length of an utf-8 string.
>>
>> Sorry, I'm very new to Unicode support. Wouldn't it be useful to have
>> UTF-8 and UTF-16 (and all the other encodings) functions in FPC?
>
> It's not that easy, for example upper/lower casing, comparing etc. of
> unicode requires usually external big tables which we don't want to pull
> into fpc.
>
I agree. Though smartly build Unicode table is not such big (it may increase
executable size by ~80KB), but it is absolutely not necessary. All
contemporary platforms have sufficient Unicode services. It is easy to
employ them.
More information about the fpc-pascal
mailing list