0

I'm encountering a problem currently.

I'm getting a string from a url, I'm decoding this string via curl_easy_unescape and I'm getting a decoded string. So far so good.

Now is where the problem is. For example, when the url had the "counterpart" to ü inside his header, curl_easy_unescape turns the counterpart of ü in \xfc. Now my String has \xfc.

I need it as a "ü".

I need a written "ü" in my string, or I'm getting an error that my string is not utf8 formatted. And i need it inside a string. For example

"Hallü howre yoü"

with curl_easy_escape this turns into

"Hall\xfc+howre+you\xfc"

And i want to revert the \xfc into "ü"s or into "\u00fc"s

My solutions i tried have been: changing the \x to \u00 . That would work and do the trick. But replacing doesn't work. encoding the string in utf 8 getting the decimal value of xFC and doing char = valueofFC.

I don't have a clue, how i could resolve that issue.

  • Do you mean `\xfc`? What's the initial encoded url? Does it use `%FC`? – bames53 Nov 05 '14 at 17:06
  • Correct. The Url uses %FC , curl_easy_unescape turns it into \xfc and then i need it to get it turned into Ü. I could live with a solution, that turns %FC directly into "ü" as well. Currently, curl_easy_unescaped was used to get it into "ü". I need to get the %FC into "ü". curl_easy_unescape just has been an attempt to get to that. PS: It has to work with every symbol. Not only ü. ä, !, æ etc as well) – Rafael Kress Nov 05 '14 at 17:10
  • 4
    The problem appears to be that you have a string encoded in ISO-8859 and you want to convert it to utf-8. There are lots of ways to do that, and questions about it [here](http://stackoverflow.com/questions/4059775/convert-iso-8859-1-strings-to-utf-8-in-c-c) – Chris Dodd Nov 05 '14 at 17:13

0 Answers0