Reputation: 6979
I am wondering: SizeOf(Char) = 2 in never Delphi versions, but this is not enough to store all integer mappings for characters defined in unicode table, right? (As far as I know there is more characters than 65536). So how this problem is solved?
Maybe two bytes are used to encode all characters from Basic Multilingual Plane (BMP)? But what happens with characters from outside the BMP?
Could someone sheed light on this?
Thanks.
Upvotes: 5
Views: 1681
Reputation: 28806
Before, if you wanted to store a single character, you could use one single Char (AnsiChar). But in Unicode, you should not be storing single UTF-16 code points in Chars (which are WideChars, in D2009+), you should be using strings, as these can contain a single Char as well as a surrogate pair.
Upvotes: 0