[Lazarus] Any chance of changing the LCL Unicode encoding to UTF-16?

Martin Friebe lazarus at mfriebe.de
Sun Aug 3 01:36:53 CEST 2008


IMHO, it would be best if a string knew it's encoding.

AFAIK, at the moment a string is prefixed by a record, containing data 
such us the amount of allocated mem, and a ref-count.
This should include a field encoding. Then you could always request the 
string in the encoding you need, and it would be converted if needed.

There was another discussion recently, about data aware components and 
the encoding from the DB. Many applications today may have to deal with 
input in more than one encoding, and then deal with this data. This 
would be much easier if the string had a memory for the encoding it has.

This may be a topic for the FPC mailing lists.


Regards
Martin

Graeme Geldenhuys wrote:
> Hi Luiz,
>
> Your timing couldn't be better!!  I was having the same discussion
> with a user in the fpGUI newsgroups. Should fpGUI change it's internal
> string encoding from UTF-8 to UTF-16?  Like you said... FPC seems to
> be very pro-Delphi compatible.  And from the discussions in the
> fpc-devel mailing list it seems they will follow Delphi to the UTF-16
> string encoding.
>
> So where does that leave the frameworks that rely on UTF-8 as the
> internal string encoding? Lazarus LCL and fpGUI?  Also where does it
> leave the applications developed with those UTF-8 enabled toolkits?
> How would such a change suggested by FPC affect all those projects?
>
> Regards,
>   - Graeme -
>
>
> On Sat, Aug 2, 2008 at 6:34 PM, Luiz Americo Pereira Camara
> <luizmed at oi.com.br> wrote:
>   
>> This is just a question not a request.
>>
>> In the recent discussion about fpc support to unicode it seems that
>> delphi compatibility is a must for fpc and since delphi will use UTF-16
>> as the main encoding in the next release, probably fpc will follow it.
>>
>> So, any chance of changing the LCL Unicode encoding to UTF-16?
>>
>> I'm asking this because i develop a component (VirtualTreeView) that
>> uses WideString/UTF-16 to support unicode and i'm planning to switch to
>> UTF-8. If LCL change to UTF-16 it will be lost of time.
>>
>> Luiz
>> _______________________________________________
>> Lazarus mailing list
>> Lazarus at lazarus.freepascal.org
>> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>>     
>
>
>
>   



More information about the Lazarus mailing list