Gmail bug Friday: Percent-encoded URLs in hyperlink text

19 Oct 2007 by Christian Eager

logo1.gifHave you ever found an interesting link, copied it, re-pasted it into your browser to make sure it worked, then sent it to a friend via Gmail using rich formatting, only to get a response that the link “doesn’t work”? I have, too many times to count.

But why? The reason is that Gmail percent-encodes every URL you create in rich text. If your URL is already percent-encoded, and you paste that into the “Enter a URL” field, Gmail percent-encodes it a second time when you send it. All the percent signs get changed to %25, meaning that when the link is clicked by the recipient, the encoded reserve characters look like numeric characters following a percent sign rather than an encoded unit.

Here’s a good example. Just today, someone sent me an image of Frida Kahlo. When he created a hyperlink to that page, it was already encoded: http://en.wikipedia.org/wiki/Image:Frida_Kahlo_%28self_portrait%29.jpg. When I received the email, it had been encoded a second time: http://en.wikipedia.org/wiki/Image:Frida_Kahlo_%2528self_portrait%2529.jpg. That link doesn’t work, and it shouldn’t.

Of course, some will say “Plain text! Only plain text!” is the solution to this bug. And it’s true, plain text is safer in general, and Gmail handles URLs in plain text just fine.

However, HTML email isn’t going away, there is a call (and rightly so) for standardization of HTML email, while keeping email legible for everyone, regardless of formatting choice, and Gmail’s hyperlink text creation shouldn’t be broken for something as simple as giving us a second helping of percent-encoding.

You can report this bug, and any other bug you’ve found in Gmail, here.


« Haptic belts in Wired
» Working Class Heroes
Copyright © 2008 Perpenduum. All rights reserved.