|Encoding problems [message #169317]
||Fri, 12 May 2006 18:33
Originally posted by: dserodio.gmail.com|
I want to have all files in my project encoded as UTF-8, but if I set
the project's encoding to UTF-8 (in the project's properties), my .jsp
file's properties show "Default (determined from content): ISO8859-1".
Shouldn't setting a project's encoding affect the JSP's encoding?
|Re: Encoding problems [message #169350 is a reply to message #169317]
||Sun, 14 May 2006 04:33
| David Williams
Registered: July 2009
On Fri, 12 May 2006 14:33:30 -0400, Daniel Serodio <email@example.com> |
> I want to have all files in my project encoded as UTF-8, but if I set
> the project's encoding to UTF-8 (in the project's properties), my .jsp
> file's properties show "Default (determined from content): ISO8859-1".
> Shouldn't setting a project's encoding affect the JSP's encoding?
No, not really. That project setting actually means "if not otherwise
The JSP spec says if the file does not specify the charset, then ISO-8859-1
should be assumed/used. So, even if we followed the project setting in
Eclipse, then it might not work right when deployed to a J2EE server.
We recommend that people "over define" the charset, just to be safe, and
be correctly interpreted by
all tools and all servers ... something like that pasted below. There is a
seperate "prefernce setting" for new files, when you go through the new
file wizards for JSP's ... this doesnt' really effect how content is
interpreted, just "fills in" the desired value in the tamplates.
= = = = = = = = =
<%@ page language="java" contentType="text/html; charset=UTF-8"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
Powered by FUDForum
. Page generated in 0.01619 seconds