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

标签: c++ encoding uri
2条回答
2楼-- · 2019-05-28 16:43

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

查看更多
戒情不戒烟
3楼-- · 2019-05-28 16:57

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.

查看更多
登录 后发表回答