Moved unicode decoding out of hex_str_to_base64 function.