On 02/17/2011 12:02 AM, Hans-Peter Diettrich wrote:
That's why such loops should be disallowed with Unicode strings, as
kind of low level string handling.
Not only this, but the normal user would like to do
MyChar := MyString[Length(MyString];
to get the last character of a string.
This would only work if length is counted in Unicode characters
disallowing the use of length in stream I/O (such as file read) functions.
Thus IMHO the Length function name should be dumped and two new
functions (such as CharacterCount and ByteCount) should be introduced.
For-Each loops may be acceptable as high level string handling, but
with what type of the loop variable???
We obviously would need a UnicodeChar Type that holds the 32 Bit encoding.
But the said "quirks" can't be handled by this. I up till now don't
understand if - technically - these "quirks" are seen as a single
Unicode character or as a sequence of Unicode Characters. Nor do I
understand how they can be used in a decent way and if they are
necessary or just legacy.
-Michael
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus