Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Japanese string converting is showing as garbled text

807588Mar 12 2009 — edited Mar 12 2009
Hi Everyone,

I have a problem while converting the Japanese string.
I am getting output as a garbled or junk text,below is the code I am trying to do that. Please help me out on this....

And can anyone tell me which is the best encoding for japanese Katanaka and Kanji characters?
class example1
{
	public static void main(String[] args) throws Exception
	{
		String str = "á*ãÅ  á á@"; //This is the input I am getting and I have hardcoded.
		String outputString = new String(str.getBytes("Cp037"), "Cp930"); // I am trying here Cp930 encoding for Katanaka and kanji char, is anyother encoding I can use it here.?
		System.out.println("Output:"+outputString);
				

	}
Thanks in advance...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 9 2009
Added on Mar 12 2009
2 comments
796 views