Version 11

    Using UTF-8 characters in portlet

     

    First - your theme has to support UTF-8 characters, sending appropriate meta tag to you browser.

     

    There are two ways you may use UTF-8 characters in your portlet

     

    1. Printing data inside your portlet with response.getWriter()

     

    In this case UTF-8 will work as is.

     

    2. Dispatching jsp page

     

    If you're dispatching a jsp page in your portlet you have to explicitly set contentType with charset in your page directive.

     

    It should look like this:

     

    <%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" contentType="text/html; charset=UTF-8"%>

     

    If you don't specify the charset, JSP engine will convert your characters to ISO-8859-1 and break all utf-8 chars.

     

    Configuring tomcat to support UTF-8 in parameters

     

    There's known problem with Tomcat that uses default encoding for parameters (again ISO-8859-1).

     

    To force it use UTF-8 edit your ${DEPLOY.DIR}/jbossweb-tomcat55.sar/service.xml or {/jboss-web.deployer/server.xml} then find all connectors declaration you use and add URIEncoding="UTF-8"

     

     

    it should like like this (for 8080 - you have to add this in all connectors you use - for example in 8443 for secure connections):

     

    <!-- A HTTP/1.1 Connector on port 8080 -->
     <Connector port="8080" address="${jboss.bind.address}"
        maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
        emptySessionPath="true"
        enableLookups="false" redirectPort="8443" acceptCount="100"
        connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8" ></Connector>