I need to decode a utf-8 string to hexadecimal. After a lot of search I found the unpack method of the string class, it can be used like:
This method seems to decode only one character and returns the decoded value as an array. The problem is that I need to decode long strings and this method seems inefficient when dealing with long strings.
Do you guys have any idea? I don’t think I should convert my string characters into arrays, convert them one by one, then join them as an array of converted characters then convert them to a string again !!!
What do you think?