title: Strange character encoding issue with Eclipse / Spring / Tomcat 6
body: <p>I have been trying things all day but can't get a proper solution. My problem is: I am developing a Spring MVC based app in my local Tomcat. My <code>MySQl</code> database has <code>UTF-8</code> encoding set, all content in there displays properly when using phpMyAdmin. Also the output in LOG files using <code>log4j</code> in catalina.out works fine.</p>
  
  <p>My JSP pages are configured by </p>
  
  <pre><code>&lt;!-- encoding --&gt;
  &lt;%@ page contentType="text/html; charset=UTF-8" %&gt;
  &lt;%@ page pageEncoding="UTF-8" %&gt;
  </code></pre>
  
  <p>Also showing data on my JSP works fine. I can also send data from my Controller without any DB intereference using special chars, e.g.</p>
  
  <pre><code>String str = "UTF-8 Test: Ä Ö Ü ß è é â";
  logger.debug(str);
  mav.addObject("utftest", str);
  </code></pre>
  
  <p>That displays <strong>correctly in log and on jsp page in browser</strong>.</p>
  
  <p>BUT: When having special chars directly in my JSP file, e.g. for text in headers, this does not work. FF and Google Chrome display strange chars but report the page to be UTF-8. When switching to Latin, the chars just get more and more strange.</p>
  
  <p>Same problem when showing text tokens from my messages.properties file, although Eclipse says when right-clicking that UTF-8 will be used.</p>
  
  <p>I am a little at lost and don't know where to check now.</p>
  
  <p>Summary:</p>
  
  <ul>
  <li>DB storage is fine</li>
  <li>DB output on JSP is fine</li>
  <li>Output on JSP directly form controller is fine</li>
  <li>even reading in form forms is fine</li>
  <li>.properties files and JSP text is <strong>not fine</strong>  !!!</li>
  </ul>
  
  <p>Any ideas? I really appreciate and tips.</p>