Hi, I'm trying to write a function to decode HTML encoded ASCII. I was just wondering if there is an easy method to convert a hex value in a string to a hex value.
i.e: "x20" to 0x20
or: "20" to 0x20
This will drastically simplify a function to convert the HTML encoded characters to their ASCII equivalent. If I can't do it like this the only other way I can think of is to manually write out each counterpart in a huge switch statement i.e:
Code:
int x = 0;
switch (string) {
case "20":
x = 32;
...
^ Which is obviously not valid code but you get the idea :P
Then casting the integer to a character and replacing it in the string.
Thanks!