title: Chinese UTF-8 characters are appearing incorrectly in Weblogic 10.3 but not Tomcat 6
body: <p>I'm developing a website using Java EE and Spring that needs to output Chinese UTF-8 characters. I have a servlet which performs a request.getRequestDispatcher(...).forward(request,response) to a jsp after some processing. In this servlet, before doing the forward, I have</p>
  
  <pre><code>response.setCharacterEncoding("UTF-8");
  response.setContentType("text/html; charset=UTF-8");
  </code></pre>
  
  <p>At the top of the jsp file (and every jsp file in my project), I have:</p>
  
  <pre><code>&lt;%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%&gt;
  </code></pre>
  
  <p>As a test, I have a Chinese UTF-8 character hardcoded on that jsp page. When I deploy this application to Tomcat 6 and hit the servlet, the browser detects the page is UTF-8 and outputs the Chinese character: 采
  When I deploy this to Weblogic 10 and hit the servlet, the browser detects the page is UTF-8 but displays: Ã©ÂÂ</p>
  
  <p>In my weblogic startup script, I have tried different java options for -Dfile.encoding, such as UTF-8 and utf8, but the Chinese character was garbled regardless of the setting.</p>
  
  <p>In weblogic.xml I have this:</p>
  
  <pre><code>&lt;charset-params&gt;
      &lt;input-charset&gt;
          &lt;resource-path&gt;/*&lt;/resource-path&gt;
          &lt;java-charset-name&gt;UTF-8&lt;/java-charset-name&gt;
      &lt;/input-charset&gt;
  &lt;/charset-params&gt;
  
  &lt;jsp-descriptor&gt;
      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
  &lt;/jsp-descriptor&gt;
  </code></pre>
  
  <p>In web.xml I have this:</p>
  
  <pre><code>filter&gt;
      &lt;filter-name&gt;encodingFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;encoding&lt;/param-name&gt;
          &lt;param-value&gt;UTF-8&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;forceEncoding&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/filter&gt; 
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;encodingFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  ...
  &lt;jsp-config&gt;
      &lt;jsp-property-group&gt;
          &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
          &lt;page-encoding&gt;UTF-8&lt;/page-encoding&gt;
      &lt;/jsp-property-group&gt;
  &lt;/jsp-config&gt;
  </code></pre>
  
  <p>But these have not solved the problem.</p>
  
  <p>All of my source files are UTF-8 encoded.</p>
  
  <p>Furthermore, when I have a .jsp or .html page with a Chinese character in it, and access it directly instead of being forwarded to it by the servlet in Weblogic, the Chinese character displays correctly. </p>
  
  <p>Also, when, in my servlet, I don't even perform the forward to the jsp and instead write Chinese characters directly to the response (using response.getWriter().write()), the Chinese character is still incorrect (even though the browser correctly determines that the encoding is UTF-8).</p>
  
  <p>Why does it work in Tomcat 6 but not Weblogic 10? How do I get the character to display?</p>