I'm trying to use forge.util.decodeUtf8 in javascript but I have not the same result with java, can you help me ?
var a = forge.util.hexToBytes("037A4078C3AD65C38863226AC3BD64C2B5392C6CCB8646617075342B473079C3954FC2A553C3BE6D");
aDecoded = forge.util.decodeUtf8(a);
console.log(forge.util.bytesToHex(aDecoded);
>> 037a4078ed65c863226afd64b5392c6c2c646617075342b473079d54fa553fe6d
This is the result in java
byte[] a = hexToBytes("037A4078C3AD65C38863226AC3BD64C2B5392C6CCB8646617075342B473079C3954FC2A553C3BE6D");
String aDecoded = new String(a, Charset.forName("UTF-8"));
byte[] r = test.getBytes();
System.out.println(bytesToHex(r));
>> 037A4078ED65E863226AFD64B5392C6C8866617075342B673079F56FA573FE6D
The difference in the result it's here
037a4078ed65c863226afd64b5392c6c**2c64**6617075342b473079d54fa553fe6d
037A4078ED65E863226AFD64B5392C6C**8866**6617075342B673079F56FA573FE6D
I don't understand why I have different result.