Reputation:
I manually changed the default encoding of a JSP file to UTF-8, but when I create a new file with template ${encoding}, the charset
is always set to ISO-8859-1
.
How do I change eclipse's setting so that UTF-8 is the default charset for JSP files?
Upvotes: 12
Views: 15026
Reputation: 2055
In Eclipse, go to Windows -> Preferences -> Web -> JSP Files
Select UTF-8 encoding from the *Encoding *dropdown box there.
Upvotes: 1
Reputation: 630
I had the same problem but changed the settings here:
Preferences -> General -> Content Types ->
Text -> JSP -> Default Encoding -> UTF-8
It worked for me. Hope it helps.
Upvotes: 19
Reputation: 4826
perhaps the same "problem" as like in Eclipse JSP: incorrect default text file encoding
Add
<%@ page pageEncoding="UTF-8" %>
to your JSP AND check the workspace encoding settings as described by Joe
Upvotes: 4
Reputation: 4930
I think you are asking how do you set the template so that ${encoding} will print out UTF-8
, rather than ISO-8859-1
.
If that's the case, you need to follow:
Window-->Preferences-->Web-->JSP Files
and then just use the drop down box to change to ISO 10646/Unicode(UTF-8)
You will also need to do the same thing for HTML files.
Upvotes: 16
Reputation: 86
I think that the encoding parameter has not been set to UTF-8 it needs to be changed from the source where it is coming.
Upvotes: 0