I have an index.html file:
<!doctype html>
<html lang="fr" class="no-js fontawesome-i2svg-active fontawesome-i2svg-complete">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>Annuaire Téléphonique</title>
...
and i deploy it into a war, served by Tomcat 9.0.35. The problem is that in the browser, the accents are like this: "Annuaire Téléphonique"
I found that the content-type served by Tomcat is false:
- curl -v http://127.0.0.1:10000/ -> Content-Type: text/html;charset=ISO-8859-1
Every piece of Tomcat configuration is configured for UTF-8. My Linux bash defines LANG=UTF-8, and Tomcat is started with -Dfile.encoding=UTF-8
I also found that when asking form index.html, tomcat does not specify encoding, which is perfect for me as index.html itself contains the Content-Type meta with UTF-8, the browser display correctly the accents
- curl -v http://127.0.0.1:10000/index.html -> Content-Type: text/html
Questions are:
- Why index.html served as welcome file (http://127.0.0.1:10000/) is served as ISO-8859-1 ?
- How can it be served as UTF-8 ? (AddDefaultCharsetFilter UTF-8 doesn't help)
Thanks for your help