What characters are allowed in an URL query string?
Do query strings have to follow a particular format?
What characters are allowed in an URL query string? Do query strings have to follow a particular format? |
|||||
|
Per http://tools.ietf.org/html/rfc3986 In section 2.2 Reserved Characters, the following characters are listed:
The spec then says:
Next, in section 2.3 Unreserved Characters, the following are listed:
|
|||||
|
Wikipedia has your answer: http://en.wikipedia.org/wiki/Query_string "URL Encoding: Some characters cannot be part of a URL (for example, the space) and some other characters have a special meaning in a URL: for example, the character # can be used to further specify a subsection (or fragment) of a document; the character = is used to separate a name from a value. A query string may need to be converted to satisfy these constraints. This can be done using a schema known as URL encoding. In particular, encoding the query string uses the following rules:
The octet corresponding to the tilde ("~") character is often encoded as "%7E" by older URI processing implementations; the "%7E" can be replaced by"~" without changing its interpretation. The encoding of SPACE as '+' and the selection of "as-is" characters distinguishes this encoding from RFC 1738." Regarding the format, query strings are name value pairs. The ? separates the query string from the URL. Each name value pair is separated by an ampersand (&) while the name (key) and value is separated by an equals sign (=). eg. http://domain.com?key=value&secondkey=secondvalue Under Structure in the Wikipedia reference I provided:
|
|||||||||||||||||
|
This link has the answer and formatted values you all need. https://perishablepress.com/url-character-codes/ For your convenience, this is the list:
|
|||||||||
|