0
char c = '3';
System.out.println(c);
System.out.println((int)c);

The problem that I'm having is getting the input of the char and turning it to unicode. Any advice would be helpful.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
fabio lapa
  • 13
  • 4
  • Not sure what you mean by "transforming into unicode"; do you want to obtain the code point? Also, remember that a `char` is a UTF-16 code unit, so only code points inside the BMP fit into a single `char` – fge Oct 26 '14 at 13:29
  • See http://stackoverflow.com/questions/2220366/get-unicode-value-of-a-character – ROMANIA_engineer Oct 26 '14 at 13:53

3 Answers3

1

You can use, for instance, Character.toCodePoint().

For code points inside the BMP (Basic Multilingual Plane; code points from U+0000 to U+FFFF), the first argument to this method will always be 0. Note that the reverse operation is Character.toChars().

fge
  • 119,121
  • 33
  • 254
  • 329
0

I dont't understand what you want on the output, unicode code of symbol or something else? And also in Java all symbols are in Unicode : Refer

igor29
  • 30
  • 6
  • a program that takes a char( for example the letter a and it gives the number that it stands for in unicode : a http://unicode-table.com/en/#0061 – fabio lapa Oct 26 '14 at 13:42
  • This doesn't answer the question. Please use the 'add a comment' button next time ([SO help about comments](http://stackoverflow.com/help/privileges/comment)) if you want clarification on the question. – GameDroids Oct 26 '14 at 15:26
-1

you can use Character.hashCode(char value).

Karo
  • 273
  • 4
  • 16