This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
May be this looks like a simple problem. But I could not get the right hook to get the solution. All I want is to get unicode for a character. We can get unicode format for a input file on the command prompt using native2ascii -encoding [encoding name] [inputfile] [outputfile].
But I want a method to convert a character to unicode or a string to unicode. Can someone show some light on this?
Thanks and Regards, Narendranath
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
A Java char is a Unicode value, so I'm not clear what you're asking. Do you want to make a String that looks like "\uXXXX" from a char value? You could use the java.text.NumberFormat class to do that easily enough.