views:

39

answers:

1

I need a library that can URLencode a string/char array.

Now, I can hex encode an ASCII array like here: http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4029

But I need something that works with Unicode. Note: On Linux AND on Windows !

CURL has a quite nice:

 char *encodedURL = curl_easy_escape(handle,WEBPAGE_URL, strlen(WEBPAGE_URL));

but first, that needs CURL and it also is not unicode capable, as one sees by strlen

+1  A: 

You can consider converting your Unicode URL to UTF8 first, the UTF8 data will carry your Unicode data in ASCII characters, Once you get your URL in UTF8 you can easily encode the URL with the API you prefer.

GJ
isn't UTF8 unicode?
maxschlepzig
UTF-8 is one of the wire protocols to transfer unicode data. It has an added advantage of being backward compatible with ASCII encoding.+1 for GJ's suggestion.
ivymike
@maxschlepzig: I thought so too. But learned something new today...
Quandary