Re: unexpected unicode behavior
Re: unexpected unicode behavior
- Subject: Re: unexpected unicode behavior
- From: Douglas Davidson <email@hidden>
- Date: Fri, 25 May 2007 09:19:29 -0700
On May 25, 2007, at 9:06 AM, Daniel Child wrote:
So I changed the NSLog to
NSLog(@"%X %S", radCodePoints[i], radicals[i]);
(where X is for hexadecimal and S is supposed to be for Unicode
strings). Now I get the correct Unicode code points (0x2F00 etc.)
but the second column is gibberish (ꁻ왴ސ for each row, and that
doesn't change.) Can someone explain what I'm doing wrong?
Try @"%X %@" for your format string. The elements of your radicals
array are NSStrings, so the correct specifier is %@, used for all
objects. There are some other potential problems with your code--for
example, unichars are integers, not floats--so you may need to make
other changes as well. Remember that the elements of your radicals
array will not necessarily be valid beyond the end of this method
unless you retain them.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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