偶然发现徽章和西班牙字符

发布于 2024-09-26 09:40:52 字数 375 浏览 1 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

玻璃人 2024-10-03 09:40:52

Stumbleupon 确实做得对。

http://www.test.com/¿cómo_se_dice

不是有效的网址

在将 URL 传递给徽章之前,您需要对 URL 进行百分比编码,或删除特殊字符。

百分比编码会导致这样的结果:

http://www.test.com/%C2%BFc%C3 %B3mo_se_dice

这里有一个在线转换器可以使用这里

Stumbleupon are actually doing it right.

This

http://www.test.com/¿cómo_se_dice

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:

http://www.test.com/%C2%BFc%C3%B3mo_se_dice

There's an online converter to play around with here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文