I want to convert unicode characters which have code values in 2 byte, 3 byte range to hexadecimal.
I know how to convert characters to hexadecimal. For which, I am first converting characters to ascii by casting using int. And from that i convert to hexadecimal using Integer.tohexString.
However, I am not sure how to deal with unicode characters like chinese, etc. Can someone help?
You should not handle the String as an array of bytes in Java… But if you want, you can use
getBytes()