[fpc-devel] Unicodestring branch, please test and help fixing

Marco van de Voort marcov at stack.nl
Sat Aug 30 16:27:15 CEST 2008


In our previous episode, Michael Van Canneyt said:
> > and back with
> > svn switch http://svn.freepascal.org/svn/fpc/trunk
> 
> What happened to the idea of dynamical encoding ? And why utf-16 ? Unix
> uses UTF-8 by default, which means that a conversion must be done each
> time you interface to the OS ? 

I assume this means Tiburon UTF-8 extension to ansistring follows on this
change.
 
So then you can (hopefully) pretty much do

{$ifdef unix} // in reality it is more complicated than ifdef unix, but for
now..
 TNativeString = type ansistring (CP_UTF8);
{$else}
 TNativeString = type TUnicodeString;
{$endif}

And use TNativeString for encoding agnostic purposes.



More information about the fpc-devel mailing list