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 internationalization for japanese text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "internationalization for japanese text" Watch "internationalization for japanese text" New topic
Author

internationalization for japanese text

Gavi Raaghav
Ranch Hand

Joined: Apr 28, 2005
Posts: 82
I am using Struts 1.1 and WAS5.1.
I am able to do i18n for spanish,german etc..but the problem comes for the japanese text.
I have mentioned the japanese text in my ApplicationResoureces_ja file but the it is rendered as junk characters on the jsp page.
I have put encoding as UTF-8 in the JSP,for the controller in the struts-config file.
But i am still getting the junk characters.

Any help would be highly appreciated.
Apratim Khandalkar
Ranch Hand

Joined: Jan 09, 2006
Posts: 34
Hi Gavi ,
We had the same problem .We were also having application that uses multiple languages and also we were using struts1.1 and was 5.1.
There are two steps to solve this problem
Add the follwing tag in JSP and this works for any language not just japanease
1>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="Shift_JIS" %>
2> Use request.setEncoding("UTF-8"); in reset method of ur ActionForm.

This should solve your problem.
Let me know if u have any problem
Bye
Apratim
Gavi Raaghav
Ranch Hand

Joined: Apr 28, 2005
Posts: 82
Thanks Apritam.
When you say Action Form u mean every action form which i am using in the application or is ther any centralized place where this can be done.
Gavi Raaghav
Ranch Hand

Joined: Apr 28, 2005
Posts: 82
This problem is still not solved. I have my ApplicationResources_js file.How do i put the japanese value in the file.Should i copy the japanese text as is or put corrosponding unicode characters or anything else.
I have tried both unicode chars and japanese text but still it shows junk chars on the screen.
I have also tried what Apritam had said but still it did not work.
Please provide any pointers towards this.
Gavi Raaghav
Ranch Hand

Joined: Apr 28, 2005
Posts: 82
its ApplicationRespurces_ja file and not js
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: internationalization for japanese text