domenica 27 luglio 2008

Web character encoding: many places to config it right

I start this entry only with few out-of-order notes: I'll put more info when I have more time.
To avoid surprises, choose UTF-8 and don't leave defaults: configure all the pieces you use.
For me, they are:
- tomcat 5.5: in server.xml, for all your connectors, set:
connectionTimeout="20000"
redirectPort="8443"

URIEncoding="UTF-8"
useBodyEncodingForURI="true"

/>
(see: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html)
(see for SEAM: https://cloud.prod.atl2.jboss.com/jira/browse/JBSEAM-3148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel)

- in JSF+facelets: (encoding of xml files + view + meta)
- to check, in browser you have to see meta and http header (mind double headers-> correct IIS or APACHE)
- html form: add accept-encoding

A must read: http://www.javaworld.com/javaworld/jw-04-2004/jw-0419-multibytes.html?page=7