• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: controlTextDidChange, backspace possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: controlTextDidChange, backspace possible?
      • From: Andreas Mayer <email@hidden>
    • Re: controlTextDidChange, backspace possible?
      • From: Douglas Davidson <email@hidden>
References: 
 >controlTextDidChange, backspace possible? (From: "Peter Karlsson" <email@hidden>)
 >Re: controlTextDidChange, backspace possible? (From: j o a r <email@hidden>)
 >Re: controlTextDidChange, backspace possible? (From: Frederick Cheung <email@hidden>)
 >Re: controlTextDidChange, backspace possible? (From: Andreas Mayer <email@hidden>)

  • Prev by Date: noteFileSystemChanged: - Bug?
  • Next by Date: Re: controlTextDidChange, backspace possible?
  • Previous by thread: Re: controlTextDidChange, backspace possible?
  • Next by thread: Re: controlTextDidChange, backspace possible?
  • Index(es):
    • Date
    • Thread