You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by JE...@thoughtworks.com on 2002/07/29 23:54:02 UTC

Struts and UTF-8 property files?

Hi,

Have deployed struts app to two countries, properties file for both
iso8859-1.  working.

Have created new properties files to test upcoming deployment to a number
of european countries.  Quickie translations automated through babelfish,
which gave us UTF-8 translations.  Added these new files to app to test.

Garbled characters resulting in browsers for special characters like german
umlat.  Browsers showing iso8859-1 as selected encoding despite meta tag
saying utf-8.  If we manually set mozilla or ie encoding to UTF-8, whoosh,
special characters all display correctly.  yay.  But of course as you
navigate with new requests/responses you get browser going back to iso8859
and garbled stuff.

So, we discovered that browser encoding auto-detect broken because the http
header coming from tomcat specified iso-8859.  Resolved this by doing a
response.setContentType("text/html; charset=UTF-8") in JSP.  But, *grin*,
NOW of course broswer autodetection of UTF-8 works - but the text which
came from the properties file is still garbled (but differently garbled
than it was originally).

Ha.  I love character encoding.  Love it.  I suspect problem is arising
when struts writes the property file value to the response in its bean
message tag (jave also has encoding for string objects).

So, does anyone out there use UTF-8 properties files with Struts?  Can it
work?  Should it work?  Can someone pay all these countries to just use
English?

Jimbo



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>