I am having problems to change the charset in my web application response from ISO-8859-1 (default) to UTF-8. I already added the VM option -Dfile.encoding=UTF-8 to the JVM options
But still, I do get the following HTTP Header as a response from the glassfish:
Content-Type: [...;charset=ISO-8859-1]
Server: [GlassFish Server Open Source Edition 3.1]
I would appreciate your help/ideas.
The
-Dfile.encodingis a Oracle JVM specific setting as to how to read Java source files. This doesn’t have any influence on the charset as specified in theContent-Typeheader of the HTTP response.You need to add the following to your
web.xmlin order to send the response of all JSPs as UTF-8 and to let it set the appropriate charset in the response header.See also: