We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi ! I have to use Japanese characters in my program, and send them via a COM port...I tried debugging to check the value of my String, and the Japanese character is inside, but the problem is when I convert to a string of bytes to port.write()
it (using data=String.getBytes()
) ,when it comes to the Japanese character it transforms it in a "?"...is there a way to make getBytes() (or any other function of the same type) split this one japanese character in the multiple bytes needed ?
Thx forward
Answers
availableCharsets(): http://docs.Oracle.com/javase/8/docs/api/java/nio/charset/Charset.html#availableCharsets--
getBytes(): http://docs.Oracle.com/javase/8/docs/api/java/lang/String.html#getBytes-java.nio.charset.Charset-
@GoToLoop Thanks a lot exactly what I was looking for ! Awesome !
@olivi55, just found out there's an even shorter & easier approach: StandardCharsets: \m/
http://docs.Oracle.com/javase/8/docs/api/java/nio/charset/StandardCharsets.html
:o really nice thx again ^^ works perfectly ^:)^