[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Feature proposal: \x## notation in strings
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 10 Mar 2009 14:04:45 -0300
> Luiz Henrique de Figueiredo wrote:
> > To avoid bloat and also because the perfect place for such a feature is
> > in a text-encoding library (which would also handle base64, ascii85, etc.)
> > Also, it is trivial to write it in Lua:
> >
>
> It may be trivial, but hexadecimal formats are pretty much a united
> feature across all programming languages with escape sequences in
> strings. [...]
Not exactly a "united" feature, as each language seems to present
a slightly different mechanism for hexadecimal characters:
* "\x7": ok in Perl and C, error in Python ("invalid \x escape").
* "\x445": ok in Perl and Python (meaning "D5"), undefined
behavior in C. (ISO says it is an error, my gcc gives a warning
and uses the value "E".)
-- Roberto