[Lazarus] I cannot use System.Length() to calculate visible width of string, now !
Андрей Гусев
ag888 at rambler.ru
Thu Jun 19 15:19:59 CEST 2008
Yes. But UTF8Length() is portable between string encodings?
Solution is clean: i must use check ifdef'ed WindowsUnicodeSupport to
choice between UTF8Length()/Length(). But maybe it already
implemented as universal and conventional solution.
And, that adjanced questuion:
Lazarus, guessed, have a tool to recognize encoding by binary
representation of string
(because Lazarus automatically recognize encodings in LFM files), so,
how i can use it ?
Graeme Geldenhuys пишет:
> You mean like the UTF8Length() function in LCLProc unit?
>
> Graeme.
>
>
>
> On 19/06/2008, Андрей Гусев <ag888 at rambler.ru> wrote:
>
>> Because Length() returns bytes count.
>> Have lazarus conventional function to calculate chars count in string,
>> that do it independently from its binary representation ?
>> "Length() div 2" is not conventional nor portable.
>>
>> _______________________________________________
>> Lazarus mailing list
>> Lazarus at lazarus.freepascal.org
>> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>>
>
>
>
More information about the Lazarus
mailing list