[fpc-devel] Unicode support (yet again)

Dimitri Smits smitco at telenet.be
Fri Sep 16 00:01:43 CEST 2011


----- "Graeme Geldenhuys" <graemeg.lists at gmail.com> schreef:

> On 15 September 2011 19:09, Hans-Peter Diettrich  wrote:
> >
> > What data type would you use, to store an UTF-8 character?
> > And how to access the n-th character in an UTF-8 string?
> 
> I already showed how in a previous post. For more details on how
> fpGUI
> does this, have a look at the fpg_base.pas and fpg_stringutils.pas
> units in the fpGUI repository.
> 
>   TfpgChar        = type string[4];
> 
> The maximum size any UTF-8 code point can be.  Basically a character
> is treated just like a string - only a small string.

errrm, utf-8 can have 6 octets representing one character, not forgetting those dioretics that are separate characters. (so I doubt representing it as above is so correct, with a short(ansi)string)

kind regards,
Dimitri Smits



More information about the fpc-devel mailing list