[fpc-devel] Unicode and UTF8String

Marco van de Voort marcov at stack.nl
Mon Dec 1 20:50:19 CET 2008


In our previous episode, Mattias Gaertner said:
> > Florian Klaempfl wrote:
> >[...]
> > My opinion is that it should be the programmers choice. I a
> > programmer wants or needs a simpler way (keeping all the strings in
> > is application in one format, which will be known to him) then he/she
> > should have that choice. And then on this type the person could
> > perform any index or index-like operation.
> 
> About: keeping all the strings in is application in one format, which will be known to him

This is not possible, since you don't control OS + headers. Most stuff will
come from the outside in the system encoding. 

This way you can do the whole app in the system encoding, and only face
conversions when outputing to the GUI, which is (relatively) infinitely slow
anyway.

You did nail a big problem though, and a weakness in Delphi's design.
What to do with classes that are used both straight and in the GUI?

> Only small programs can do that. All others use third party packages.
> If you want choice, then all used third packages must support all
> possible choices. Unlikely.

If you want to be the  lowest common denomitor and ask nothing from the 3rd
party packages, it is the best to stay with Ascii.




More information about the fpc-devel mailing list