Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top