DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16365>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16365

bean:message tag not writing correctly from application properties file encoded in 
utf-8

           Summary: bean:message tag not writing correctly from application
                    properties file encoded in utf-8
           Product: Struts
           Version: 1.0.2 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Custom Tags
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


We have created application_fr_CA.properties encoded in utf-8 and use the 
bean:message tag to retrieve the messages from this file. The JSP directive 
charset is set to utf-8 so is HTML charset. In IE6 on W2K the encoding in view 
manu is auto-selected and the setting is utf-8. This means that the browser is 
treating the incoming stream as utf-8 encoding. However, some characters 
retreived by the bean:message tag are not displayed correctly. When we change 
the encoding of the application_fr_CA.properties to iso-8859-1, all characters 
are displayed correctly. It seems that the tag is treating the 
application_fr_CA.properties as iso-8859-1 encoded even though it is utf-8 
encoded. We did the following conversion in the JSP with JDK ResourceBundle 
class:
  ResourceBundle oResource = ResourceBundle.getBundle
( "application.properties", request.getLocale() );
  out.print(new String( oResource.getString( aKey ).getBytes
("ISO8859_1"), "UTF8"));

This will write correctly from an utf-8 encoded application_fr_CA.properties 
file.

We have the same problem with Jakarta Commons Validator in that the messages in 
the Javascript pop-up window are not displayed correctly when they are 
retrieved from application_fr_CA.properties file which is utf-8 encoded.

I think the bean:message tag can be enhanced so it will retrieve messages 
correctly from an utf-8 encoded property file.

Thank you very much.
Sincerely,
Deedee Zhang

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to