Hi all,

This problem has been solved since I use <fmt:message> in all my jsp(s) and native2ascii all my properties file.

Recently I am trying to use ResourceBundleViewResolver and I can save my effort to i18n some static content by <fmt:message>. ResourceBundleViewResolver works ok because it display the correct jsp when i switch between locales. However, the chinese character in the jsp still display some "monster character". The last resort is to native2ascii the jsp file also..........Any better solution ?

Jonathan

action-servlet.xml :
<bean id="pdfViewResolver" class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
       <property name="order" value="1" />
       <property name="basename" value="views"/>
</bean>

JSP contain chinese character:
<?xml version="1.0" encoding="UTF-8"?>
<%@ include file="/common/taglibs.jsp" %>
<p>測試abc</p>

p.s.:
I am using Appfuse 1.9.3 and Spring MVC


Brett Knights wrote:
I imagine the need for the native2ascii conversion has to do with how properties files are interpreted. From the apidocs for java.util.Properties.load()

"The stream is assumed to be using the ISO 8859-1 character encoding; that is each byte is one Latin1 character. Characters not in Latin1, and certain special characters, can be represented in keys and elements using escape sequences similar to those used for character and string literals"

so properties files are interpreted as iso-8859-1 regardless of the actual encoding.

It might be a nice option for somewhere in v2 to use the xml format for properties but that's a Java 5 and later option.

HTH

As far as your jsp files xml is again your friend. You could convert all your jsp's to the xml format and specify the encoding in the pre-amble:

<?xml version="1.0" encoding="UTF-8"?>


HTH

Jonathan Tse wrote:
I am using appfuse 1.9.3 , thx

wnqq wrote:
please let us know which version of appfuse you are talking about.


Jonathan Tse wrote:
Hi all,

I am currently working on the i18n part of my application. I notice that I need to perform a native2ascii conversion for my ApplicationResources_zh*.properties or otherwise I will get some monster character. Why is that? The file are already encoded in UTF-8. Moreover, if I type chinese character in any jsp file, they result in monster character , too.

I am really got no clue on these kind of encoding issues. Could anyone provide some explanation? Thanks a lot in advance.

Best regards,
Jonathan




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




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


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

Reply via email to