[Lazarus] Lazarus Directory Structure .

Mehmet Erol Sanliturk sanliturk at ttnet.net.tr
Tue Aug 5 02:44:06 CEST 2008


2008/8/4 Ivan P. Gan <ivan at comchatter.com>:
> It is however better to have a single encoding format for all platforms that
> Free pascal & Lazarus support

I agree. While researching the issue with unicode I came across a very
good article the other day. Unicode was design using UTF-16 at first.
No need for variable amounts of bytes to present a character. 2 bytes
is all that was needed. It proved a better idea that UTF-8 which
required 1-4 bytes. Then to there surprise 65000 code points was not
enough so UTF-16 ended up have encoding pairs - just the thing they
tried to avoid!  Oops.

The other compelling reason I think for UTF-8 is that it always
represents data in byte form. No need for a byte order mark. Plus many
people consider the fact that it is very unlikely to use characters
above the BMP so they normally don't bother implementing support for
it. So they intend to have UTF-16 support, but in fact only have UCS2.
MSEgui is such a case, but at least they only claim UCS2 support which
is good in a way (no false advertising). Also because the higher BMP
characters are seldom used, the code path for working with those are
hardly used and normally not well tested. So many implementation bugs
can slip though the cracks. Because UTF-8 works with variable byte
data from the start, it's implementation is normally well tested.

I'll try and find that article again and post the URL here... It was
interesting reading.


> As my work is web based, I find UTF-8 very effective providing a good
> balance on size & function

And because it's byte based it lends itself well to data transfer and
exchange. Probably with the W3C recommends UTF-8 for web pages and
XML.

> Does using UTF-16 correct the Russian separator problem?

No. Some of the locale variables used in FPC are Char type
(AnsiString), so they can only store 1 byte of data. The Russian
thousand separator requires 2 bytes.


Regards,
 - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the Lazarus mailing list