Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Showing string in different language  RSS feed

 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In a servlet when I am doing:

String s = "\u4F9D\u5B58\u3057\u305F";
out.println(s);

I am able to see the content in Japanese. But when I am getting the same String thorugh a collection like a HashMap I am not able to see the content in Japanese:

Iterator iterator = map1.keySet().iterator();
while(iterator.hasNext())
{
String s = (String) iterator.next();
out.println("s : " + s);
}

I am seeing \u4F9D\u5B58\u3057\u305F on the browser.

What's the reason?

I am setting the response content type to UTF-8:

request.setCharacterEncoding("UTF-8");

response.setContentType("text/plain; charset=UTF-8");
response.setHeader("Content-Language", "ja");
response.setHeader("Vary", "Accept-Language");
response.setCharacterEncoding("UTF-8");

Thanks and Regards,
Amit Sanghai.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"izon shita"

Are you sure you've got the right values in the map ?
You're using the keys of the map. Check that the s.equals((String) iterator.next());
[ March 16, 2007: Message edited by: Satou kurinosuke ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"izon shita"


??

I think is another language words and I thought its used to say Hi! right Satou ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, it is the japanese sentence supposed to be displayed with the above unicode
izon = dependency
izon suru = to depend on something
[ March 16, 2007: Message edited by: Satou kurinosuke ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess was wrong in meaning of this sentence.

no need to say sorry for that.. I get my answer in your post..? Thanks for your reply..
 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, what happened to my question's reply? I have tested, the values in the map are right.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!