I asked a week ago a question about this, now I tried to google around and found this toHex method. It has an empty spot about the charset. For example I want to use UTF-8 but if I enter it returns an error and if I don't specify it, the output is huge amount of 0s and few numbers afterwards. My goal is a Hex representation of the entered string
public String toHex(String arg) {
return String.format("%040x", new BigInteger(1, arg.getBytes(/*YOUR_CHARSET?*/)));
}
public static void main(String[] args){
EncodingHex ec = new EncodingHex();
System.out.println(ec.toHex("abv"));
}