[Lazarus] I cannot use System.Length() to calculate visible width of string, now !

Vincent Snijders vsnijders at quicknet.nl
Thu Jun 19 14:53:31 CEST 2008


Graeme Geldenhuys schreef:
> You mean like the UTF8Length() function in LCLProc unit?
> 

He mean that, but that is not independently from its binary 
representation: it assume UTF8 binary representation.

OTOH, I don't think you can make a function Length without telling it 
(implicitly or explicitly by using a parameter) the used encoding.


> 
> 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.

Vincent



More information about the Lazarus mailing list