illegal escape character

Discussion in 'Java' started by Steve Rainbird, Jun 7, 2006.

  1. Any ideas why I get the following syntax error?

    illegal escape character
    wsV1 = "\x1c";

    --
    Steve

    Remove "nospam" from email address to reply to me personally
     
    Steve Rainbird, Jun 7, 2006
    #1
    1. Advertising

  2. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Steve Rainbird schreef:
    > Any ideas why I get the following syntax error?
    >
    > illegal escape character
    > wsV1 = "\x1c";


    "\\x1c", see http://mindprod.com/jgloss/regex.html#QUOTING

    HTH, H.

    - --
    Hendrik Maryns

    ==================
    http://aouw.org
    Ask smart questions, get good answers:
    http://www.catb.org/~esr/faqs/smart-questions.html
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQFEhwhDe+7xMGD3itQRAnbNAJ9Yz8GkjNgeFmA2XD4+UbY1ia88ZQCeJ45A
    STYGDuE4yWD/CjIIv0p6dzY=
    =2te7
    -----END PGP SIGNATURE-----
     
    Hendrik Maryns, Jun 7, 2006
    #2
    1. Advertising

  3. "Hendrik Maryns" <> wrote in message
    news:e67183$t0d$-tuebingen.de...
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > Steve Rainbird schreef:
    >> Any ideas why I get the following syntax error?
    >>
    >> illegal escape character
    >> wsV1 = "\x1c";

    >
    > "\\x1c", see http://mindprod.com/jgloss/regex.html#QUOTING
    >
    > HTH, H.
    >
    > - --
    > Hendrik Maryns
    >
    > ==================
    > http://aouw.org
    > Ask smart questions, get good answers:
    > http://www.catb.org/~esr/faqs/smart-questions.html
    > -----BEGIN PGP SIGNATURE-----
    > Version: GnuPG v1.4.2 (GNU/Linux)
    >
    > iD8DBQFEhwhDe+7xMGD3itQRAnbNAJ9Yz8GkjNgeFmA2XD4+UbY1ia88ZQCeJ45A
    > STYGDuE4yWD/CjIIv0p6dzY=
    > =2te7
    > -----END PGP SIGNATURE-----



    Hendrik,

    thanks for helping but what I actually meant by this is the "hex 1c" like in
    c.

    I know I can have

    wsV1 = "\u001c";

    But my manual says I can use "\x" as well.



    --
    Steve

    Remove "nospam" from email address to reply to me personally
     
    Steve Rainbird, Jun 7, 2006
    #3
  4. Steve Rainbird

    Andy Flowers Guest

    Steve Rainbird wrote:
    > "Hendrik Maryns" <> wrote in message
    > news:e67183$t0d$-tuebingen.de...
    >> -----BEGIN PGP SIGNED MESSAGE-----
    >> Hash: SHA1
    >>
    >> Steve Rainbird schreef:
    >>> Any ideas why I get the following syntax error?
    >>>
    >>> illegal escape character
    >>> wsV1 = "\x1c";

    >> "\\x1c", see http://mindprod.com/jgloss/regex.html#QUOTING


    >
    > But my manual says I can use "\x" as well.
    >
    >
    >


    See http://mindprod.com/jgloss/literals.html. \x isn't supported in Java.

    Which manual are you using ?
     
    Andy Flowers, Jun 7, 2006
    #4
  5. "Steve Rainbird" <> wrote:
    > thanks for helping but what I actually meant by this is the "hex 1c" like
    > in c.
    >
    > I know I can have
    >
    > wsV1 = "\u001c";
    >
    > But my manual says I can use "\x" as well.

    Your manual is wrong!
    See the ultimate reference at
    http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6
    ("Escape Sequences for Character and String Literals"). You see: "\x" is not
    listed as a valid escape sequence.

    --
    Thomas
     
    Thomas Fritsch, Jun 7, 2006
    #5
  6. "Andy Flowers" <> wrote in message
    news:SUEhg.209$...
    > Steve Rainbird wrote:
    >> "Hendrik Maryns" <> wrote in message
    >> news:e67183$t0d$-tuebingen.de...
    >>> -----BEGIN PGP SIGNED MESSAGE-----
    >>> Hash: SHA1
    >>>
    >>> Steve Rainbird schreef:
    >>>> Any ideas why I get the following syntax error?
    >>>>
    >>>> illegal escape character
    >>>> wsV1 = "\x1c";
    >>> "\\x1c", see http://mindprod.com/jgloss/regex.html#QUOTING

    >
    >>
    >> But my manual says I can use "\x" as well.
    >>
    >>
    >>

    >
    > See http://mindprod.com/jgloss/literals.html. \x isn't supported in Java.
    >
    > Which manual are you using ?



    SAMS Teach yourself java 2 in 21 days.

    --
    Steve

    Remove "nospam" from email address to reply to me personally
     
    Steve Rainbird, Jun 7, 2006
    #6
  7. "Thomas Fritsch" <> wrote in message
    news:e67egc$528$02$-online.com...
    > "Steve Rainbird" <> wrote:
    >> thanks for helping but what I actually meant by this is the "hex 1c" like
    >> in c.
    >>
    >> I know I can have
    >>
    >> wsV1 = "\u001c";
    >>
    >> But my manual says I can use "\x" as well.

    > Your manual is wrong!
    > See the ultimate reference at
    > http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6
    > ("Escape Sequences for Character and String Literals"). You see: "\x" is
    > not listed as a valid escape sequence.
    >
    > --
    > Thomas
    >



    So it seems. Thanks everybody at least that explains it.

    --
    Steve

    Remove "nospam" from email address to reply to me personally
     
    Steve Rainbird, Jun 7, 2006
    #7
  8. Steve Rainbird

    Mark Space Guest

    Steve Rainbird wrote:
    > SAMS Teach yourself java 2 in 21 days.
    >


    SAMS sux! ;)
     
    Mark Space, Jun 8, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William Brogden
    Replies:
    1
    Views:
    8,412
    Manoj S. P.
    Jun 30, 2003
  2. Michael Lee
    Replies:
    0
    Views:
    1,567
    Michael Lee
    Jun 27, 2003
  3. Timo Nentwig
    Replies:
    1
    Views:
    3,581
    Igor N. Kolomiyets
    Feb 6, 2004
  4. Andy Fish

    illegal character in xml file

    Andy Fish, Feb 6, 2007, in forum: XML
    Replies:
    1
    Views:
    553
    Joseph Kesselman
    Feb 6, 2007
  5. slomo
    Replies:
    5
    Views:
    1,606
    Duncan Booth
    Dec 2, 2007
Loading...

Share This Page