[fpc-devel] Unicode support - for the 20th time... ;-)

Michael Schnell mschnell at lumino.de
Thu Nov 20 12:25:19 CET 2008


> For best backward compatibility, I would say Copy, Length, Pos etc
> should work by "character based" by default. 
Agreed.
> Then introduce more
> optimised versions like ElementCopy, ElementLength, etc...  Old
> programs will work out of the box, but might experience a minor speed
> penalty, until the developer has time to convert to the more optimise
> calls.  Just a thought?
>   
Agreed (but the speed penalty might be huge !) That is why I vote for a 
compiler option to safe the programmer the work to modify his code.
> And to replace  SomeString[x]  code with a unicode safe / equivalent,
> we can implement a CharAt(str, x) method.
>   
Here another problem might arises, as the "character" type needs to be 
defined accordingly (supposedly):
String               Character
ANSIString       ANSIChar    (1 Byte)
UTF8String      UTF8String
UCS2String      UCS2Char   (2 Byte)
UTF16String     UTF16Char (4 Byte)/


-Michael



More information about the fpc-devel mailing list