As I'm trying to convert below hex to java string. As this is UTF8 Characters.
ЫЙБПАРО
As this string is converted into hexadecimal 42b41941141f41042041e
value.
I tried to convert string to hex by using below javascript code
function encode(string) {
var str= "";
var length = string.length;
for (var i = 0; i < length; i++){
str+= string.charCodeAt(i).toString(16);
}
return str;
}
I need to decode in java code what would be the way.
Tried below answers
mkyong.com/java/how-to-convert-hex-to-ascii-in-java
stackoverflow.com/questions/140131
Convert a string representation of a hex dump to a byte array using Java?