如何在c ++中模仿js decodeURIComponent? [英] how to mimic the js decodeURIComponent in c++?

查看:187
本文介绍了如何在c ++中模仿js decodeURIComponent?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有字符串(uri),我需要在c ++中解码,它必须是js decodeURIComponent函数
,以便这个字符串:

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

将如下所示:

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

是有一些mini类处理c ++中的所有uri编码?
谢谢

解决方案

如果您正在寻找一个小型跨平台库来执行此操作,请考虑使用 a href =http://uriparser.sourceforge.net =nofollow> uriparser 。 BSD许可证和外部依赖关系


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

解决方案

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

这篇关于如何在c ++中模仿js decodeURIComponent?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆