Re: Efficiently receiving data from an NSTask
Re: Efficiently receiving data from an NSTask
- Subject: Re: Efficiently receiving data from an NSTask
- From: "Michael Ash" <email@hidden>
- Date: Mon, 7 Jul 2008 12:04:04 -0400
On Mon, Jul 7, 2008 at 11:52 AM, Charles Srstka
<email@hidden> wrote:
> 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.
You're right, my bad. I even checked 0xC0 to make sure it was the
right one, but I guess I got momentarily distracted and somehow put in
this nonsense instead.
Mike
_______________________________________________
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