• 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: unexpected unicode behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >unexpected unicode behavior (From: Daniel Child <email@hidden>)

  • Prev by Date: Re: NSTreeController bound selection issue
  • Next by Date: Re: unexpected unicode behavior
  • Previous by thread: unexpected unicode behavior
  • Next by thread: Re: unexpected unicode behavior
  • Index(es):
    • Date
    • Thread