[fpc-devel] utf8 reading

Florian Klaempfl F.Klaempfl at gmx.de
Thu Mar 10 19:12:32 CET 2005


Uberto Barbini wrote:

>>>utf-8 is a unicode string. What do you mean with "not escaped"
>>>Unicode? Memory wasting utf-32?
>>
>>I'd see UCS2/UCS4 as not escaped Unicode.
> 
> 
> Exactly.
> I think that UCS2 will suffice to everyone not interested in Vogon poetry! ;))
> This means to have 2 byte chars and related strings, all string functions made 
> compatible and function to import/export to utf-8 and charset strings.

UCS-2 or UTF-16 how it called by the unicode consortium is "escaped" as 
well and you've to take care of it in your code. Even in utf-32 you've 
to take care of surrogate pairs.

> 
> Another way is to use a flag to force all string to be compiled as UCS2 (or 
> UCS4 for Vogon poets).
> 
> Using natively utf-8 I think is impossible, because the encoding.

Why?

> 
> Please note that at every Borland conference there is someone asking for 
> Unicode support since Delphi2...
> 
> There are several opensource library for managing unicode strings in delphi 
> but they are implemented as standard classes, not refcounted first class 
> citizen as long-string.





More information about the fpc-devel mailing list