Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #28401

Re: "\x1337\xcafe"?

From BGB <cr88192@hotmail.com>
Newsgroups comp.lang.c
Subject Re: "\x1337\xcafe"?
Date 2012-11-19 11:54 -0600
Organization albasani.net
Message-ID <k8dru6$v5$1@news.albasani.net> (permalink)
References <86vcd284km.fsf@gray.siamics.net> <k8cpjl$gi9$1@news.albasani.net> <k8djcl$erp$1@speranza.aioe.org>

Show all headers | View raw


On 11/19/2012 9:31 AM, glen herrmannsfeldt wrote:
> BGB <cr88192@hotmail.com> wrote:
>
> (snip)
>
>> this is the defined behavior for C.
>
>> \x will parse any number of characters provided they all look like hex,
>> and is used regardless of character size (say, if the string uses
>> wide-characters, ...).
>
>> this is not the case though for many other languages though, which often
>> take the interpretation that \x is followed by exactly 2 characters, and
>> add things like \u and \U to deal with wider characters.
>
> But \u and \U, in Java at least, do more than that, as one will find
> out if one tries to put a \u0022 into a string.
>

yeah... Java handles escapes before it parses the strings...


this isn't really the case though for other languages which have 
borrowed the \u and \U syntax, which have (AFAICT) generally more 
interpreted it as a character escape for use within strings.


in the case of my language, it is a special case currently handled in 
two places:
as a character escape in a string;
as part of an identifier.

most everything else is limited to plain ASCII, or would involve using 
UTF-8 (my parser is kind-of hard-coded to assume UTF-8). (note that my 
project stores most strings internally as UTF-8).


or such...

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

"\x1337\xcafe"? Ivan Shmakov <oneingray@gmail.com> - 2012-11-19 13:55 +0700
  Re: "\x1337\xcafe"? Nobody <nobody@nowhere.com> - 2012-11-19 07:39 +0000
  Re: "\x1337\xcafe"? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-11-19 07:57 +0000
  Re: "\x1337\xcafe"? Keith Thompson <kst-u@mib.org> - 2012-11-19 00:07 -0800
    Re: "\x1337\xcafe"? "BartC" <bc@freeuk.com> - 2012-11-19 11:55 +0000
      Re: "\x1337\xcafe"? Ike Naar <ike@sverige.freeshell.org> - 2012-11-19 12:10 +0000
        Re: "\x1337\xcafe"? lawrence.jones@siemens.com - 2012-11-20 17:42 -0500
          Re: "\x1337\xcafe"? James Kuyper <jameskuyper@verizon.net> - 2012-11-20 18:29 -0500
    Re: "\x1337\xcafe"? Ivan Shmakov <oneingray@gmail.com> - 2012-11-19 20:08 +0700
    Re: "\x1337\xcafe"? Robert A Duff <bobduff@shell01.TheWorld.com> - 2012-11-23 19:52 -0500
      Re: "\x1337\xcafe"? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-11-24 02:34 +0000
      Re: "\x1337\xcafe"? James Kuyper <jameskuyper@verizon.net> - 2012-11-24 11:31 -0500
      Re: "\x1337\xcafe"? Keith Thompson <kst-u@mib.org> - 2012-11-24 12:08 -0800
  Re: "\x1337\xcafe"? BGB <cr88192@hotmail.com> - 2012-11-19 02:08 -0600
    Re: "\x1337\xcafe"? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-11-19 15:31 +0000
      Re: "\x1337\xcafe"? BGB <cr88192@hotmail.com> - 2012-11-19 11:54 -0600

csiph-web