I have been using Apache Velocity for years in my Tomcat web platform.
I was under very old versions: velocity-1.6.4 and velocity-tools-1.4 and I recently decided to migrate my whole platform and to use velocity-engine 2.3 and velocity-tools 3.1
Since I have around 15 web applications, the process was a bit long but quite straightforward. Unfortunately, I have some rendering problems, specially :
- The Euro sign € is not rendered properly.
- When the web page loads external scripts with labels, (accents in French, special characters) they seem to be ANSI characters.
Here is the kind of stuff I get:
Accents, dollar, punctuation: àèù, $, ! ?,
Euro sign: ?
From external js : éà èù $##!?€
The same template, with same tomcat configuration, but with the very old versions of velocity displays perfectly. If plain HTML, it also works (the Connectors in Tomcat config file server.xml precise UTF-8).
Every thing is in UTF-8. The velocityservlet is a basic "velocity servlet", as simple as possible. With the last versions of Velocity, the velocity properties config file only contains:
resource.loaders = webapp
resource.loader.webapp.class = org.apache.velocity.tools.view.WebappResourceLoader
resource.loader.webapp.path = /WEB-INF/templates/
I have checked by code inside the servlet that the property getVelocityProperty(RuntimeConstants.INPUT_ENCODING, RuntimeConstants.ENCODING_DEFAULT) was UTF-8.
After nights and days on the problem, I feel quite desperate! Thank you for your help.