I am trying to pass the Euro ( € ) sign as url parameter in my spring jsp. What is the right way to do so ? I tried the following with no avail. Problem is the character is getting encoded properly but not getting decoded from my destination jsp.
I am using
<%@page contentType="text/html;charset=UTF-8" %>
Here is the calling jsp:
<script>
...
// params contains the euro sign
document.location='dest.jsp?p='+escape(params);
In the dest.jsp
<input type="hidden" id="par" value="${param.p}">
and in a script in the same page
console.log($('#par').val())
- when I use escape(params) I get the url as %u20AC . But no (empty) values in the dest.jsp
- when I use encodeURI(params) or encodeURIComponent I get url as € . But the value in dest.jsp as
â¬
- something which I can't use to render as euro sign