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
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel