• 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
converting unicode text representation to unichar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

converting unicode text representation to unichar


  • Subject: converting unicode text representation to unichar
  • From: Daniel Child <email@hidden>
  • Date: Tue, 11 Aug 2009 10:40:31 -0400

Unihan.txt provides text files showing characters in the format U+XXXX.
If I scan these in, naturally I can obtain the NSString representation XXXX.
But I need to convert this text to genuine unichars OR NSStrings (the actual characters represented).


Two questions:

1. I didn't see any relevant conversion methods under NSString or NSNumber. Are there Cocoa functions to perform this easily?

2. I am assuming I have to convert to the format '0xXXXX', but is it also possible to work with U+XXXX directly in cocoa? I got error messages for all of the following formats:

unichar uch = 'U+XXXX';
unichar uch = '0xXXXX';
unichar uch = '\uXXXX';
NSString uch = @"\uXXXX";


So I'm a bit confused about how to get from the four numbers XXXX to a meaningful NSString or unichar representation.


Thanks.
_______________________________________________

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


  • Follow-Ups:
    • Re: converting unicode text representation to unichar
      • From: "Adam R. Maxwell" <email@hidden>
    • Re: converting unicode text representation to unichar
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: [iPhone] seeking advise on complex view design
  • Next by Date: Re: CATransition + NSView mask
  • Previous by thread: Re: [iPhone] seeking advise on complex view design
  • Next by thread: Re: converting unicode text representation to unichar
  • Index(es):
    • Date
    • Thread