[fpc-pascal] TListBox bug in LCL of Lazarus?

Jürgen Hestermann juergen.hestermann at gmx.de
Sun Dec 21 16:42:10 CET 2008

>> And how do I change my current code to UTF-8?
> In the menu Tools --> Convert encoding of file/project

I used the Delphi-to-Lazarus convertion for my (Delphi) program. Why 
isn't it also converting to UTF-8 if that's necessary?

> But I never used it. I would just open in a text editor which can
> handle multiple encodings, like notepad++

You mean: Don't use Lazarus but use an alternative standard editor? What 
purpose is the IDE then?

>> Thanks for the link. But why isn't it documented in the Help of TListBox? No
>> word there that the strings may be UTF-8 only (and that you somehow have to
>> store your code files in that coding if you use stings constants).
> Because it applies to all of LCL. We would need to repeat that for all
> classes from the LCL.

In a documentation I would expect to find such important information (at 
least as a link). Otherwise I don't need it at all and can find out how 
it works myself by trial and error.

> You cannot not use Unicode with Lazarus. Only UTF-8 is supported,

Isn't UTF-8 unicode in the same way as UTF-16?

> There is obviously some work to be done when migrating to Unicode, but
> you will be very happy if you ever need to localize your application
> to Russian or chinese, because the application is already unicode
> capable and can easely support those languages.

Yes. I don't have a problem with Unicode at all, just the opposite. I 
only miss a clear help that tells me that TStrings in the LCL have to be 
UTF-8 per definition. And it would have saved me lots of debugging hours 
if the strange bug would not have omitted the whole string whenever they 
contain extended characters. It took me a very long time to realize that 
it's a bug in the LCL and that it's related to extended characters and 
that it can be avoided by using AnsiToUTF8.

Jürgen Hestermann.

More information about the fpc-pascal mailing list