[fpc-devel] Unicode and UTF8String

Marco van de Voort marcov at stack.nl
Mon Dec 1 21:15:04 CET 2008


In our previous episode, Felipe Monteiro de Carvalho said:
> On Mon, Dec 1, 2008 at 5:40 PM, Florian Klaempfl <florian at freepascal.org> wrote:
> >> What string type will be TStrings.Items and the many other strings in
> >> the classes.pp?
> >
> > Not yet decided though I'd make them RTLString as well.
> 
> I think you can't change TStrings because that would break all code
> using it (huges amount of code).

Depends. The few last msgs kept me thinking, and if what I saw on the web
about Tiburon is correct, they simply control the type of ansistring in
tstringlist, and default let it be the system encoding. (default like in old
delphi). For unicodecontrols they set some new property or so to change it
to UTF8, and take the conversion penalties for granted.

This allows them to do 

  MyStringList.SaveToFile('SomeFilename.txt', TEncoding.Unicode);  

It has to be something like that, since if mystringlist always was
ansistring in whatever ISO encoding, that would be a pretty pointless
unicode control.





More information about the fpc-devel mailing list