Liberté
12-27-2005, 12:47 PM
Hi everyone,
I am working on a JSP web application using the Spring framework. I am having trouble with URI encoding for form submission when it comes to the javascript escape() function and the + symbol. The symbol is sent to the server unescaped but when it is decoded by the request object on the server side, the + is converted into a space. So for example, if "C++" is submitted in a form, it is decoded on the server side as "C ".
I am wondering if anyone could give me a suggestion for how to solve this problem. Unfortunately using the encodeURI() function is not an option as we are using iso-8859-1 encoding on the server side (it is an intranet application), and changing the server behaviour is not an option for me at this point. Since encodeURI() encodes in UTF-8 format, I end up with this when I use it instead of escape():
Input: développeur
Output: dă©veloppeur
Thanks in advance for any help you can provide!
I am working on a JSP web application using the Spring framework. I am having trouble with URI encoding for form submission when it comes to the javascript escape() function and the + symbol. The symbol is sent to the server unescaped but when it is decoded by the request object on the server side, the + is converted into a space. So for example, if "C++" is submitted in a form, it is decoded on the server side as "C ".
I am wondering if anyone could give me a suggestion for how to solve this problem. Unfortunately using the encodeURI() function is not an option as we are using iso-8859-1 encoding on the server side (it is an intranet application), and changing the server behaviour is not an option for me at this point. Since encodeURI() encodes in UTF-8 format, I end up with this when I use it instead of escape():
Input: développeur
Output: dă©veloppeur
Thanks in advance for any help you can provide!