Reputation: 6228
I need to pass '+'
via the QueryString
.
some special character can be passed by using 'Encode' .. but '+'
I know the one solution, If I replace '+' with other character.
But it's not the perfect solution.
[edited]
well I used escape()
javascript function to encode.
escape function can't encode +
. is the another function to encode on javascript?
Upvotes: 1
Views: 176
Reputation: 171421
Rather than handling on a case by case basis, with Javascript you can encode all data you pass via query string with encodeURIComponent
<script>
var data = ")(@&^$@*&^#!(!*++=";
var encodedData = encodeURIComponent(data);
alert(encodedData);
</script>
Upvotes: 4
Reputation: 383756
In ASCII, the hex code for +
is 2B
, so you should be able to just use %2B
instead of +
.
http://www.google.com/search?q=c%2B%2B+java
Upvotes: 0
Reputation: 24360
The space character is usually passed as %20
.
The same way, the plus sign can be passed as %2B
Upvotes: 1