0

I want to develop a program, that will take a input in chines font through GUI, but, I have face a problem, that is how can I decode the given string in Unicode. I can write a string giving the correct Unicode Value, but donot fetch the correct Unicode value.

I just add a code..

String str1 = "ABC";
byte btArr[] = str1.getBytes("utf-16BE");
for(int i=0;i<btArr.length;i++)
	System.out.print(btArr[i]);

It gives 065066067 like this. But I think it is not a exact unicode value, because

String str2 = "\u0041\u0042\u0065";
System.out.println("New::"+str2);           // New::ABe

This will generates from correct Unicode value(got from http://sbcs.sunysb.edu/documentation/jdk/api/java/lang/package-summary.html)

So, how will I get the exact Unicode value in Java, please give me a code example.

Please give me a correct way to make my project..

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by DangerDev
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.