Re: controlTextDidChange, backspace possible?
Re: controlTextDidChange, backspace possible?
- Subject: Re: controlTextDidChange, backspace possible?
- From: Frederick Cheung <email@hidden>
- Date: Wed, 15 Sep 2004 02:24:17 +0200
On 15 Sep 2004, at 02:08, Andreas Mayer wrote:
Am 14.09.2004 um 17:13 Uhr schrieb Frederick Cheung:
Also it is a bad idea (tm) to truncate a unicode string at an
arbitrary index or delete some arbitrary range. You could get
unexpected results or even an invalid string.
Are you sure? Could you give an example?
We are not talking about byte ranges here. Characters are really that
- unicode characters. I think it's perfectly fine to delete any range
you want. Of course the look of certain characters may change (e.g.
when deleting a part of a ligature), but it should never result in an
invalid string. I hope. :)
Surrogate pairs. Quoting from tn 2078:
"Surrogate pairs - Unicode sets aside 2,048 code point values (U+8000 -
U+DFFF) in the BMP which will never be assigned to actual characters.
They are reserved for defining paired combinations to represent
characters outside the BMP. These values are called surrogates. The
first 1,024 surrogate values (U+D800-U+DBFF) are called
high-surrogates, and the remaining 1,024 surrogate values
(U+DC00-U+DFFF) are called low-surrogates. A supplementary-plane
character (a character not in the BMP) is represented by high-surrogate
followed by a low-surrogate. Note that surrogates are only legal when
they occur in high-low pairs. An unpaired surrogate is considered an
error in Unicode."
There can also by funky stuff like é (e acute accent if the list
mangles this) can be encoding as 2 characters, deleting one of them
will produce a slightly odd string.
Fred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden