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

"Андрей Гусев (Andrey Gusev)" ag888 at rambler.ru
Mon Jun 23 12:15:36 CEST 2008


Mattias Gaertner пишет:
> On Thu, 19 Jun 2008 17:19:59 +0400
> Андрей Гусев <ag888 at rambler.ru> wrote:
>
>   
>> 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 ?
>>     
>
> There is a simple heuristic.
> The function is in lcl/lconvencoding.pas function GuessEncoding.
>
>   
Thanks.




More information about the Lazarus mailing list