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=11267>.
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=11267

bean:message bug





------- Additional Comments From [EMAIL PROTECTED]  2002-08-01 03:21 -------
I think you're a little confused about what's happening.

Any properties file you want to use for message resources must be encoded using 
ISO 8859-1. That means that if its native format is *not* ISO 8859-1, you must 
use the native2ascii tool to convert it into that encoding. That conversion 
process causes any characters which are not in ISO 8859-1 to be encoded using 
Unicode escapes. If you look at a properties file after this conversion, you 
will see non-ISO 8859-1 characters represented as something like \u1234.

Unicode can represent any character, regardless of which other character sets 
that character may exist in. That is its purpose in life. It is also the native 
character encoding of Java strings. Therefore, when a propreties file is read 
in as a message resource, the Unicode escaped characters in the properties file 
become regular Unicode characters in the string, just as the unencoded 
characters do.

The <bean:message> tag takes a Java string - which is a Unicode string - and 
effectively passes that to the servlet/JSP container. It is the container's job 
to convert the Unicode string to whatever character encoding you specified in 
your JSP pages.

UTF-8 is a representation of Unicode that can be transmitted as "text" to a 
browser. If you specify UTF-8 in your JSP pages, then the container will 
convert the strings it gets from <bean:message> to UTF-8 before serving them up 
to the browser. Similarly, if you specified Big5 on your JSP pages, the 
container would convert the Unicode strings to Big5 before sending them to the 
browser.

So if your properties files started out using Big5 encoding, then you convert 
them using native2ascii, use them as message resources, and output them using 
<bean:message> to a page declaring Big5 encoding, the end result is exactly 
what you would want - the Big5 message from your original properties file 
displayed by the browser from a Big5 encoded page. The same is true for any 
encoding you choose, assuming it is supported by the JDK you are using.

I hope this helps explain the process. For more on the encoding of properties 
files, see:

http://java.sun.com/j2se/1.4/docs/api/java/util/Properties.html

and for information on the native2ascii tool, see:

http://java.sun.com/products/jdk/1.1/docs/tooldocs/solaris/native2ascii.html

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

Reply via email to