I've been developing a web application using spring mvc. When I deploy it on openshift using tomcat 7 and mysql database I get the following issue. Greek letters coming from an HTML MULTIPART form are saved in the database like:
ÃÂÃÂÃÂÃÂýñÃÂ
The issue doesn't appear in my local deployment where the characters are correctly saved as Greek letters. In order to ensure UTF-8 encoding in my jsp and html i used:
<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
In my web.xml:
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
In order to connect to the DB I use the following parameters in the connection URL: ?useUnicode=true&characterEncoding=UTF-8
I've also changed the following DB parameters to utf-8: character_set_client, character_set_connection, character_set_database, character_set_results, character_set_server and the collations to utf8_general_ci. This was done through SET queries.
Any ideas on what may cause the encoding issue and how to solve it?
UPDATE: HTML form is multipart