Using Java, Servlets, MySQL, Tomcat and Velocity, the following steps were taken:

* velocity.properties :
	+ input.encoding=UTF-8
	+ output.encoding=UTF-8
* server.xml
	+ URIEncoding = UTF-8
* `<html><head>` Charset
	+ meta http-equiv="Content-Type" content="text/html;CHARSET=UTF-8"
* eclipse properties, project properties, file & editor encoding
	+ set all that apply to UTF-8
* JDBC connection:
	+ db.url=jdbc:mysql://:/?useEncoding=true&characterEncoding=UTF-8
* java/servlet code:  

	+ request.setCharacterEncoding( UTF-8 )

All of the above didn't work. Until the following code was done:

```
private String getParameter(String key) {
    String param = request.getParameter(key);
        if (Util.isNotEmpty(param)) {
            try {
                return new String(param.getBytes("8859_1"), "utf-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
            return param;
        }
    return null;
}

```

The above means that `request.setCharacterEncoding` didn't have an effect ( `getCharacterEncoding()` does return UTF-8 ); knowing that the request wrapper is wrapped in a `ThreadLocal` object.

How is this caused and how can I solve it?