Can anyone please help me in converting string to hex and hex to string for following string which is in arabic and english.
String str = "مصطلحات : RAM : Random";
Can anyone please help me in converting string to hex and hex to string for following string which is in arabic and english.
String str = "مصطلحات : RAM : Random";
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