converting unicode text representation to unichar
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