how to mimic the js decodeURIComponent in c++?

2019-05-28 15:55发布

问题:

i have string (uri) that i need to decode in c++ , its have to be as js decodeURIComponent function so that this string :

http://external.ak.fbcdn.net/safe_image.php?d=AQBuv4KHE_CDlCPV&w=130&h=130&url=http00253A00252F00252Fi1.ytimg.com00252Fvi00252F8dWcLkK62lM00252Fhqdefault.jpg

will look like this :

http://i1.ytimg.com/vi/8dWcLkK62lM/hqdefault.jpg

is there some mini class that deal with all uri encoding in c++ ? Thanks

回答1:

If you are looking for a small cross platform library to do this, Consider using uriparser. BSD license and no external dependencies



回答2:

check out http://uriparser.sourceforge.net/

it's a C library, so no problem to use it under C++

Crossplatform Windows,Linux,etc. Under linux you can install it with apt-get.



标签: c++ encoding uri