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

Java String does not recognize Japanese Characters

 
Vadivel Murugesan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I am trying to print string with Japenese Characters.
But i get Junk Characters as Output
I have changed regional Settings to Japanese also.
Still i am getting problem.
Help me to get this.


Thanks in Advance
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are you printing these to - a console or terminal of some kind? Most of those don't support non-ISO-8859 (or even non-ASCII) characters.
 
Vadivel Murugesan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for response.

The java program itself contains the Japanese characters. We're trying to print the output on Dos command prompt (windows xp) by running the java program.



 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that won't work.
 
Vadivel Murugesan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you dont mind can you give us the technical explanation why it won't work. We wanted to know the other possibilities if any.

Thanks in advance
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does not work because the Windows XP console window does not normally support those characters - it doesn't have anything to do with the Java program itself. You would probably need a Japanese version of Windows to make the command prompt show these characters. Or use something else than the command prompt window to show the output of your program.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just not something that most consoles and terminals were built for. There may be more advanced consoles that can display all Unicode characters -provided all required fonts are present-, but I'm fairly certain that the DOS console can't.

Furthermore, System.out.println will convert anything using the platform default encoding, which on Windows generally is CP-1252 or something like that - which doesn't support CJK characters.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic