Re: Using Flex/Lex in a Cocoa project
Re: Using Flex/Lex in a Cocoa project
- Subject: Re: Using Flex/Lex in a Cocoa project
- From: Ricky Sharp <email@hidden>
- Date: Mon, 18 Aug 2008 20:12:48 -0500
On Aug 18, 2008, at 8:01 PM, John Joyce wrote:
On Aug 18, 2008, at 7:01 PM, email@hidden wrote:
to avoid the splitting problem
(c < 128) ? "%c" : "\\ux", c);
Not quite sure what this is doing.
I see it's checking for ASCII range
if ( c < 128 )
The conditional is obvious,
but what's the other doing exactly?
returning a char if it is ASCII, it seems,
and then some sort of escaped version if it is beyond ASCII range...?
Particularly there, I'm not sure what that results in.
That was my question too. If operating on a UTF-8 stream, this is
going to do all kinds of weird stuff.
For example, for the input string LATIN SMALL LETTER E WITH ACUTE (U
+00E9), you'll have a UTF-8 byte sequence of 0xC3 0xA9.
But the above will turn that UTF-8 sequence of bytes into this string:
"\u00C3\u00A9"
This string now represents:
LATIN CAPITAL LETTER A WITH TILDE (U+00C3) followed by COPYRIGHT SIGN
(U+00A9)
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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