On Fri, 5 Oct 2007 09:27:59 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I asked a similar question in the MSEgui newsgroup as well.  What was
> the reason for choosing to support UTF-8 instead of UTF-16?
> 
> ----- Quoted Mattias from 6 months ago  --------------
> The LCL will support UTF-8 and provide some extra functions for
> UTF-16, because UTF-8 is more compatible to existing pascal programs
> -----------   END   --------------
> 
> 
> Does this mean UTF-8 was chosen only because it is more compatible
> with existing pascal programs?  Any other reasons?
> 
> These are the pro points I received for using UTF-16 in MSEgui.
> 
> * It is faster to work with UTF-16 (and so WideString) encoded text
> compared to UTF-8.
> * Easier to implement.
> * WideString allows indexed "[]" accessing individual chars.
> * Has predictable "length()" value.  (not sure what they meant here)

This all assumes UTF-16 has only 2-byte characters, but there are
4-byte characters too.
The above is true for UTF-32.


> * Most widget toolkits and libraries have WideString API's already.
> (Win32, Xft, Xlib etc..)

And all platforms have functions for UTF-8.


The main reason is:
UTF-8 is more compatible to existing pascal programs, because they use
'string', not widestring.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to