偶然发现徽章和西班牙字符
url 的 stumbleupon 徽章代码
http://www.test.com/¿cómo_se_dice
使用类似于以下代码片段的
<script src="http://www.stumbleupon.com/hostedbadge.php?s=2&r=http://www.test.com/¿cómo_se_dice"></script>
,它将将该 url 识别为 http://www.test.com/cmo_se_dice
并删除西班牙语字符。
在将 url 添加到代码片段之前是否有特殊的方法来处理它?
using the stumbleupon badge code for a url like
http://www.test.com/¿cómo_se_dice
with the following snippet
<script src="http://www.stumbleupon.com/hostedbadge.php?s=2&r=http://www.test.com/¿cómo_se_dice"></script>
it will recognize the url as http://www.test.com/cmo_se_dice
and remove the spanish characters.
is there a special way to treat the url before adding it to the snippet?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Stumbleupon 确实做得对。
这
不是有效的网址。
在将 URL 传递给徽章之前,您需要对 URL 进行百分比编码,或删除特殊字符。
百分比编码会导致这样的结果:
这里有一个在线转换器可以使用这里。
Stumbleupon are actually doing it right.
This
is not a valid URL.
You would need to either percent-encode the URL before passing it through to the badge, or remove the special character.
Percent-encoding would result in this:
There's an online converter to play around with here.