• 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: NSString and utf16
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString and utf16


  • Subject: Re: NSString and utf16
  • From: Alastair Houghton <email@hidden>
  • Date: Wed, 16 Apr 2008 16:53:23 +0100

On 16 Apr 2008, at 16:43, Alexander Cohen wrote:

I have an NSString that contains this Unicode character: '\u00e9'. I have another app that represents the same character as 'e\u0301'. Is there any way to transform one to the other so that isEqualToString returns YES?

Yes. You want to look at the string normalization methods (e.g. - decomposedStringWithCanonicalMapping).


Which one you want to use before your comparison depends on exactly what you are trying to achieve; e.g. you might want to use the compatibility mapping rather than the canonical mapping instead (which will map superscripts and subscripts, font variants, circled characters etcetera to related but not entirely equivalent forms).

The book "Unicode Demystified" is quite useful if you get particularly involved with this kind of thing (as is the Unicode book itself).

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSString and utf16 (From: Alexander Cohen <email@hidden>)

  • Prev by Date: Re: Resizing NSView with CABasicAnimation
  • Next by Date: Re: Why should we set ivars to nil in dealloc?
  • Previous by thread: Re: NSString and utf16
  • Next by thread: printing in Cocoa
  • Index(es):
    • Date
    • Thread