Meaningless Drivel is fun!*
The moose likes JSF and the fly likes How to set encoding to utf-8 ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to set encoding to utf-8 ?" Watch "How to set encoding to utf-8 ?" New topic
Author

How to set encoding to utf-8 ?

Marco Schmitz
Greenhorn

Joined: May 19, 2009
Posts: 1
hello,

on my index.xhtml I've got a <a4j:form> with a <rich:suggestionbox>.

This suggestionbox must show texts in utf-8, but it doesn't.

The suggestionbean works fine, logging tells me that the strings are fetched correctly (db is utf8, xml unmarshalling with castor is utf8)

So I started my journey

1) the xhtml file is utf8 (thanks to eclipse)

2) the xhtml header is utf8:
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />

3) in the server.xml everything is set to utf8:
<Connector ... URIEncoding="UTF-8" useBodyEncodingForURI="true" />

4) in web.xml there is a filter defined that does this:
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");

can you please help me on this?

greetings,
darolla
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to set encoding to utf-8 ?