Re: \x and strings



Martin Richter [MVP] wrote:
> Hallo Frank!
>
>> The escape sequence for embedded bytes is three characters following
>> the \x so your "unicode" example is the correct way for non-unicode
>> strings, a\x001bc will work properly for single byte characters.
>
> Sure? I am confused now...
>
> I just found this in the docs:
> Mobile and Embedded Development
> Embedded Operating System Development
> Windows CE
> Windows CE .NET
> Product Documentation
> Development Tools
> Microsoft Embedded Visual C++ 4.0
> C/C++ Language Reference
> C++ Language Reference
> Lexical Conventions
> Literals
> C++ Character Constants
>
> Octal escape sequences, specified in the form \ooo, consist of a
> backslash and one, two, or three octal characters. Hexadecimal escape
> sequences, specified in the form \xhhh, consist of the characters \x
> followed by a sequence of hexadecimal digits. Unlike octal escape
> constants, there is no limit on the number of hexadecimal digits in an
> escape sequence.
>
> Anybody here who has a copy of the standard?

That's consistent with what the standard says in 2.13.2:

escapesequence:
simpleescapesequence
octalescapesequence
hexadecimalescapesequence

simpleescapesequence: one of
\' \" \? \\
\a \b \f \n \r \t \v

octalescapesequence:
\ octaldigit
\ octaldigit octaldigit
\ octaldigit octaldigit octaldigit

hexadecimalescapesequence:
\x hexadecimaldigit
hexadecimalescapesequence hexadecimaldigit

-cd


.



Relevant Pages

  • Re: online awk application - viable
    ... feasibility of writing a web application to carry out pattern matching in ... The main problems are that the browser will escape some characters in the ... # character for the original escape sequence. ... # Hex is a string in the form \xnn where n is in the set 0-9a-f. ...
    (comp.lang.awk)
  • Re: online awk application - viable
    ... feasibility of writing a web application to carry out pattern matching in ... be implemented in php or another language but awk (which I have not used ... The main problems are that the browser will escape some characters in the ... # character for the original escape sequence. ...
    (comp.lang.awk)
  • Re: formatting text in JavaScript popup boxes
    ... there is also few additional special characters: ... which serves as escape sequence prefix itself ... Is there some Javascript popup Alert box text formatter, ...
    (comp.lang.javascript)
  • Re: What is wrong with this call?
    ... \c is an undefined escape sequence ... I doubt very much that your filename includes those characters. ... If your question is worth asking, it is worth puting in the the body of your message. ...
    (comp.lang.c)
  • Re: escape sequences, cursor positioning
    ... Say the field is 30 characters long. ... underscore, then write 30 spaces, then send an escape sequence to go ... Following up on the suggestion to set the terminal to display ...
    (comp.os.vms)