I'm using datapicker
but the utf8 characters are displaying wrong in my html like DéCEMBRE
or AOûT
. All my files (.jsp & .js) are saved as utf-8.
$( "#datepicker" ).datepicker({
//...
monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août',
'Septembre', 'Octobre', 'Novembreé', 'Décembre'],
//...
});
Also i set this:
<head>
<meta charset="UTF-8">
<script src="${pageContext.request.contextPath}/resources/js/calendar.js" charset="UTF-8"></script>
<script src="${pageContext.request.contextPath}/resources/js/datepicker.js" charset="UTF-8"></script>
We solved the problem and The solution was weird because after doing all the possible solution as Xavier propose
Here are different thinks to think about: international characters in Javascript in short: Meta must have UTF8, files must be saved as UTF8(important!) and your Webserver may need to have UTF8
The problem was not fixed so I make a clean..
and clean Tomcat Work Directory
in my tomcat server and I restart it. I refresh the page In chrome but I still got wrong character
So I try with Mozilla and the problem was finally solved also i open a new window in Chrome using ctrl+shift+n. This will open a new incognito window and the character display good.
So for normal chrome it works after i closed the tab and i open it again.
So i think it's a cache problem in apache tomcat
or in browsers cache so to avoid this problem you have to try all this solution ;)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments