2016-08-01 26 views
-4

誰でも、文字列を16進数と16進数に変換して、アラビア語と英語の次の文字列に変換する際に助けてください。文字列を16進数に変換し、その逆を

String str = "مصطلحات : RAM : Random"; 
+2

可能性のある重複した[文字列に六角と六角に文字列を変換する方法は?](http://stackoverflow.com/questions/15020812/how -to-convert-string-to-hex-and-hex-to-string) – sinclair

答えて

2
byte[] myBytes = "مصطلحات : RAM : Random".getBytes("UTF-8"); 
String hexString = DatatypeConverter.printHexBinary(myBytes); // to hex String 

byte[] bytes = Hex.decodeHex(hexString.toCharArray()); 
new String(bytes, "UTF-8"); // decode it back 

私はこのquestionを使用して、このanswer

+0

ありがとう#Rudziankouが試行します。 –

関連する問題