Re: NSString to bit pattern
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