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/30 17:56:40 UTC

Help with bean:message encoding problem (UTF-8) anyone?

Hi,

Trying again here with more info:

If I access a property file containing UTF-8 encoded values via a scriplet
in a JSP, the characters come out fine in various browsers.  Here is the
scriplet:

    <%  String testString = MessageResource.getMessage
("message.enterZipCode",
                             new Locale("DE", "de"));
        testString = new String(testString.getBytes(), "UTF-8");
    %>
    <%=testString%>


If I try to render the same property within a strutsified page via
bean:message, I get garbage where the special characters appear.

I'm pretty ignorant about character encoding schemes, I confess.  Am I
missing something obvious?

I am using tomcat 4.03 and struts 1.01 with jdk 1.3.02 on windows machines.
In both of the above cases, the meta tag in the html specifies UTF-8 and
the http header coming from tomcat to browser specifies UTF-8.

I realize iso is normal with european languages.  The reason I have UTF-8
to deal with at this point is that we have quickie translations done by
babelfish engine which outputs UTF-8.  In any case, when our applications
begin to move to asian countries, we'll have multiple encodings to deal
with for certain.

Thanks,

Jim



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