I've got the following problem. I created a new "Dynamic Web Project" and imported some existing jsp files into it.
If i right click one of the imported jsp files and click "Properties" > "Resource" then under the "Text file encoding" section a value of "Default (determined by content type: ISO-8859-1)". However i have runned iconv before importing to assure they're in utf-8:
$ iconv -f "ISO-8859-1" -t "UTF-8" from.jsp > to.jsp
All the jsp files has the following meta set:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Does anybody know how to change this setting? Tomcat is serving them correctly as utf-8 (http content-type header), so i don't really know in what this impacts...
It's not a bug, it's a feature
Eclipse didn't "determine" the correct encoding by scanning the file as like file or iconv commands on your shell.
Solution: Add following line to your JSP:
<%@ page pageEncoding="UTF-8" %>
This is a good Idea due to many Web-Container will force to deliver ISO-8859-1 encoded files nevertheless you have set the correct content type in your HTML Header.
FYI: Mismatching CharacterSets and file encodings will lead
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With