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!

Determining Unicode Values

dadams07May 18 2006 — edited May 18 2006
Is there a reliable way to determine the Unicode value of any character? For example, the following code
String string = "Việt";
for (int i = 0; i < string.length(); ++i)
{
   char c = string.charAt(i);
   System.out.println(c + " = " + Character.getNumericValue(c));
}
Gives this output:

V = 31
i = 18
? = -1
t = 29

Not too helpful, since the one character I really care about is shown as -1.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2006
Added on May 18 2006
10 comments
281 views