Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

internationalization for japanese text

 
Gavi Raaghav
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its ApplicationRespurces_ja file and not js
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic