File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Issues adding i18n Chinese support to existing Struts based code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Issues adding i18n Chinese support to existing Struts based code" Watch "Issues adding i18n Chinese support to existing Struts based code" New topic
Author

Issues adding i18n Chinese support to existing Struts based code

Brian Fed
Greenhorn

Joined: Feb 07, 2010
Posts: 6
I started working on a new assignment of Struts based maintenance J2EE project. I am new to Struts and having some trouble understanding the code and I seek Struts expers help here .

Basically we need to add Internationalization support to the existing Struts based code and here I am trying to show Japanese characters in the browser.



my jsp code looks like below:









globaltech-formatter.tld






struts-customer.xml







What I did ?


1.
I started creating a new file using the Notepad editor on Windows XP . The file is then saved as type "Unicode Big Endian"
Next, using the native2ascii utility from JDK 1.4 SDK, I use the following command to convert this file to an ASCII file:
native2ascii -encoding UnicodeBig CustomerResources_zh.ucd CustomerResources_zh.properties
The resulting output CustomerResources_zh.properties contains the required escape code.
I am using this file CustomerResources_zh.properties in my web project.

2.
In my internet explorer, Tools --> Internet Options --> Languages tab, I added the language "Chinese (Hong Kong S.A.R.) [zh-HK]"


3.
When I fire a request to my jsp, I see garbage character in my browser instead of chinese characters.
I tried to even add this line
<%@ page contentType="text/html; charset=utf-8" %>
to top of my jsp file but still no use.





Can you please clarify what I am missing here and how to add i18n support for Chinese locale to my existing Struts based code ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issues adding i18n Chinese support to existing Struts based code