• 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 to bit pattern
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString to bit pattern


  • Subject: Re: NSString to bit pattern
  • From: Greg Guerin <email@hidden>
  • Date: Fri, 8 May 2009 16:09:30 -0700

Andrew Farmer wrote:

One extra complication: By Cocoa's standards, a string is not a sequence of bytes: it's a sequence of Unicode codepoints.* To treat a string as a "bag of bytes", you will first need to choose a text encoding to treat the text as, then convert it using the NSString dataUsingEncoding: method.


I didn't say a string was a sequence of bytes. I didn't even use the word "byte" in my reply. This was subtle, but intentional.

The interpretation of "character" was intentionally left as an exercise for the reader to decide. It could mean "ASCII character". It could mean "UTF8 byte". It could mean "Unicode code-point". It depends on what bit-pattern the reader is interested in.

However, the interpretation of a "character" doesn't change the sequence of the elements in the string. They are still arranged in a sequential order, and the process of breaking it down is the same regardless of the coding.

  -- GG

_______________________________________________

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


  • Prev by Date: Re: AppleEvents and modal dialogs
  • Next by Date: Re: NSString to bit pattern
  • Previous by thread: Re: NSString to bit pattern
  • Next by thread: Not sleeping - Why?
  • Index(es):
    • Date
    • Thread