How do we control charset encoding in Apache and Tomcat?

Solution Unverified - Updated -

Issue

We are having problems rendering special characters in Apache and Tomcat from EWS 1.0.1 even though that same code worked fine on our old Sun web and app servers.  We believe we need UTF-8 throughout, but the code specifies different character sets.  We are asking the developers to clean that up but we also need to confirm what can be done on the server side.  Note this code runs through Tomcat and Apache serves as a proxy.  Here's what I've identified to date:

  1. Set encoding in Apache by adding 'AddDefaultCharset utf-8' to the end of httpd.conf

  2. Set encoding in Tomcat by adding 'URIEncoding="UTF-8"' to the connector in server.xml

  3. Set encoding in Tomcat by adding a MIME type mapping:

        <mime-mapping>
             <extension>jsu</extension>
             <mime-type>application/x-javascript;charset=UTF-8</mime-type>
        </mime-mapping>

Are there any other server side settings we can try, or should those listed above be used together?  Other than these options does it just come down to encoding in the application (JSPs, Servlets, and filters) or is there another place to set character encoding?

Environment

  • JBoss Web Server (JWS)
    • 3.x
    • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content