[fpc-devel] Unicode support (again)

Daniël Mantione daniel.mantione at freepascal.org
Tue Nov 11 14:22:40 CET 2008



Op Tue, 11 Nov 2008, schreef Michael Schnell:

>
>> Remember that an individual code point does not nessacerally represent what 
>> a user would consider a character. ...
> Again, there is no compatible handling of this with good old ANSIStrings, 
> anyway, so there is not "friendly old school" way that a compiler would be 
> able to offer. In these special cases, the user of course needs to explicitly 
> handle the upgrade of his project to unicode. If the differences or 
> ambiguities are relevant in the project in question, the user of course needs 
> to write code for that. Only if handling the issue in the same "old school" 
> way as ANSIStrings provide, the user should be able to write the same code as 
> he is used to do.
>
>> Given theese facts code point counts and indexes are not much more usefull 
>> than code unit indexes and counts.
> I never said that "code point counts and indexes are more useful", but 
> forcing the programmer to create much more complex and less straight forward 
> code only because the underlying system now uses unicode, even if he would be 
> perfectly happy with ANSI, does not make much sense to me. If he really needs 
> unicode specifics (or wants to optimize his code for space or time) he of 
> course should be aware that things are complex and he needs to dig deeper.
>
> Do you really want to explain a newcomer that and why he can't any more do

IMO widestrings with precomposed characters, just like ansistrings, can 
fullfill the needs of a newcomer. That there exists decomposed characters, 
surrogates, and more, does not need to be explained in chapter 1 of a 
programming for beginners book.

Daniël


More information about the fpc-devel mailing list