cobines schrieb:
2011/9/15 Michael Schnell <mschn...@lumino.de>:
In fact users want to deal with "decently coded characters" and not with
"cryptic bytes some of which together are representing a character". (e.g.
when doing MyChar := MyString[1]; )

I think of Unicode text as a stream of Unicode characters in some
format. I trust that functions that deal with the string Copy, Length,
Find, etc., know how to handle it.

Right.

When doing:
MyChar := MyString[1]

appropriate function retrieves first unicode character, regardless of encoding.

This is just wrong :-(

MyString[1] accesses the first element of the *physical* character array, regardless of any encoding. Also Length returns the array size, not the number of *logical* characters in it.

Whether it's utf8, utf16, utf32 or any other future encoding the code
should work the same.

Very new functions are required for dealing with *logical* characters, in every MBCS encoding.

DoDi

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to