aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Japanese Text in javascript alert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Japanese Text in javascript alert" Watch "Japanese Text in javascript alert" New topic
Author

Japanese Text in javascript alert

R P Kumar
Greenhorn

Joined: Sep 07, 2010
Posts: 6
Hi

I am implementing internationalization in my application. I am able to display the labels in Japanese language by using a separate property file. But I am facing issues in displaying Japanese text in alert messages and in tool tips. The text is coming as squares in IE. Same is working fine in Mozilla. I tried to do this in an html file and I am getting the saame issue. Below is the html file I have written.
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<body>
<script>
alert('\u9069\u7528');
</script>
</body>
</html>

Can anyone please help to resolve this issue?

Thanks
Ratheesh
Prabhakar Reddy Bokka
Ranch Hand

Joined: Jul 26, 2005
Posts: 193

R P Kumar wrote:




I think the charset you are using is wrong. Is that character you are trying to use belongs to UTF-8??
Try using other charsets like ISO 8859-1.


SCJP 5, SCWCD 5
R P Kumar
Greenhorn

Joined: Sep 07, 2010
Posts: 6
Hi

The charset is UTF-8. I created the unicode for the japnese text using the native2ascii utility.

Thanks
Ratheesh
R P Kumar
Greenhorn

Joined: Sep 07, 2010
Posts: 6
Hi

The issue was not in the code. But problem was, IE was not able to display the characters in Japanese because it uses the OS installed language features to display alert and tooltip messages. I was not having Japanese language support installed in my machine. After installing it, I was able to see the alert and tooltip messages in Japanese.

Thanks
Ratheesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Japanese Text in javascript alert