-4

Is the combination \; an escape sequence for semicolon i.e. ;.

Pardon me for the shortness of the question before, actually I am using this "\;" to escape the ";" on Linux terminal and as well as windows. It is being used to separate the different parameters querystring of a URL. Using only ";" works for windows but not on Linux. However using "\;" instead of ";" works for both Linux and windows. The URL is being passed to some command for processing the resource pointed by URL.

My query was simply, Is '\;' a standard escape character for ';' on linux and windows console/shell ?

Twaha Mehmood
  • 737
  • 3
  • 9
  • 26

5 Answers5

7

In urls, the escape symbol for ; is %3B

For more information see http://www.december.com/html/spec/esccodes.html

lucas
  • 1,050
  • 12
  • 21
alhimikst
  • 428
  • 3
  • 10
1

No. But the combination \; will give an error. I think you have to try \\; instead of \;.

Because ; is not a escape character in Java. And with \ you can only put the escape characters. If you want some non-escape characters with \ then you have to use \\

Chandra Sekhar
  • 18,914
  • 16
  • 84
  • 125
1

Semicolon does not need escaping in urls.

You can test it yourself in your javascript console (for Chrome, or maybe Firebug in FF) by using encodeURI(';')

Seki
  • 11,135
  • 7
  • 46
  • 70
  • 1
    Yes and no. Semicolon is not special in URLs themselves, but they *are* special in the parameter list in the query component (sometimes, they are used in place of `&`). Then they need to be escaped. – jpalecek Jun 05 '12 at 11:34
0

No. In URLs, you escape by %XX where XX is the hex code of the character you want. You can get the correctly escaped string easily in javascript by using the escape() or encodeURIComponent() functions.

See this other question for more

Community
  • 1
  • 1
jpalecek
  • 47,058
  • 7
  • 102
  • 144
0

Your url read pass the arugumnets encodeURIComponent