There is strange character encoding going on. I am using JSP (JSTL) and Struts with Tomat 6.
I have my JSP page encoding as such:
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
The issue is when I try to pass the url using encodeURI as such:
<script type="text/javascript">
$('#mailer_filter').change(function(){
var val = $(this).val();
console.log(val);
console.log(escape(val));
console.log(encodeURI(val));
location.href = 'mailList.a?' + encodeURI($(this).val());
});
</script>
the parameter on the action (java end) comes out as:
Gaz M??tro
however on the front end it is displayed as:
Gaz Métro
which is the correct way. What I can do about this??
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…