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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to