I have a problem with encoding and Jetty.
All my files are encoded in UTF-8 and include the correct HTML meta tag to specify UTF-8.
Until now all my UTF-8 files had a BOM and I had no problem. But now I am using a different text editor and I noticed that my UTF-8 files are now generated without a BOM which from what I read is rather a good thing so I decided to go without BOM from now.
But the problem is that it seems that Jetty converts all my JSP files to ISO8859-1 before sending them to the browser if they don't have a BOM. It causes problem because since they have a meta tag for UTF-8 the browser interprets the files as UTF-8 and accents and other special characters do not work.
I found one workaround so far which is to start all my JSP files with :
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
This works but it is kindof annoying because I have to add this at the start of every file and I would rather have some server wide parameter to avoid that, if it is possible, but as I spent hours browsing the web for a solution I am beginning to think there is none.
I tried to add
JAVA_OPTIONS+=("-Dfile.encoding=UTF-8")
to my JAVA_OPTIONS when starting jetty as suggested in an other thread but it doesn't seem to do anything.
Any help would be greatly appreciated.