On Jul 7, 2008, at 10:16 AM, Michael Ash wrote:

3) Look for a clean break in the UTF-8 sequence. This is not as
difficult as it sounds. There are two easy scenarios where you can
break. The first is after any ASCII character. You can scan your
NSMutableData buffer for any char value <= 127, and break at that
location. Second, you can break *before* any char value that matches
this mask:

   c & 0xA == 0xA

This will find a char whose first two bits are both 1.

Um, no it won't. The mask for the first two bits would be 0xC0, not 0xA. 0xA would be 0101, which other than being the ASCII newline character, doesn't seem terribly interesting for this use.

Charles
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to