2
$\begingroup$

In a comment to Henry's answer in a recent question I copied a link from Wikipedia directly from my browser window to the comments box. However, upon submitting the comment, the link was misinterpreted.

The original link was: http://en.wikipedia.org/wiki/Box–Muller_transform

After some experimentation, I believe the error is due to the en-dash in Box–Muller being stripped out (or not being converted to a regular dash).

When I tried copying the link to other browsers on my machine, there was no problem.

This occurred in Mac OS X (10.6.8) with Firefox 6.0.2, but I doubt the problem is specific to either of these.

I realize this question/comment is not specific to math.SE, but it seems relevant to alert people here as I suspect that some links to math articles might be more susceptible to the bug mentioned above.

Addendum: As Asaf's comment has so aptly demonstrated, the problem occurred while using the [title](link) syntax in the comments. For example, I used:

[Box-Muller transform](http://en.wikipedia.org/wiki/Box–Muller_transform)

and this appears to have gotten translated upon comment submission to

[Box-Muller transform](http://en.wikipedia.org/wiki/BoxMuller_transform)

$\endgroup$
  • $\begingroup$ No a complete solution, but a workaround: [title](link) works just fine. For example: Box-Muller transform $\endgroup$ – Asaf Karagila Sep 26 '11 at 8:32
  • $\begingroup$ Note that your link does not work. This was my point. :) Should I clarify my question? $\endgroup$ – cardinal Sep 26 '11 at 8:35
  • $\begingroup$ Yes. You should :-) I will leave the comment, it may be useful for the next user coming around. $\endgroup$ – Asaf Karagila Sep 26 '11 at 8:36
  • $\begingroup$ @Asaf, you reproduced the exact bug cardinal is mentioning. Nice proof of concept... $\endgroup$ – Did Sep 26 '11 at 8:36
  • $\begingroup$ @Didier: Would you believe me if I would say this was on purpose? :-P $\endgroup$ – Asaf Karagila Sep 26 '11 at 8:52
  • $\begingroup$ @Asaf, not quite. Sorry... :-) $\endgroup$ – Did Sep 26 '11 at 9:06
  • 1
    $\begingroup$ If you must, you can percent-encode like so: [Box–Muller transform](http://en.wikipedia.org/wiki/Box%96Muller_transform) gives Box–Muller transform. $\endgroup$ – J. M. is a poor mathematician Sep 26 '11 at 10:50
  • 1
    $\begingroup$ @J.M., Thanks. I understand all of this. My question (quibble?) was prompted by the fact that it is reasonable to assume that if I copy and paste a link directly from my browser window, it should still work. :) More in my remarks to Jeff below. $\endgroup$ – cardinal Sep 26 '11 at 11:54
  • $\begingroup$ With all due respect, Jeff, I realize there is a deceptively tricky technical issue involved, but the tag bug was chosen carefully. This is a bug. :) $\endgroup$ – cardinal Sep 26 '11 at 12:23
  • $\begingroup$ @cardinal not a bug. Use the toolbar button or ctrl+l to insert links if this a concern; that is what it is for. $\endgroup$ – Jeff Atwood Sep 26 '11 at 12:37
  • $\begingroup$ @Jeff: Apparently your interface works different than mine. ;) (Special Jeff-only build?) Neither of those work from a comment box. $\endgroup$ – cardinal Sep 26 '11 at 12:40
  • $\begingroup$ BTW: the problem is especially acute when pasting in Wolfram Alpha links in comments. That reminds me... $\endgroup$ – J. M. is a poor mathematician Sep 26 '11 at 12:56
2
$\begingroup$

These oddball characters Wikipedia allows in URLs are an endless source of annoyance.

The good news is that they are not required -- the simple ASCII versions work as well. So try:

http://en.wikipedia.org/wiki/Box-Muller_transform
http://en.wikipedia.org/wiki/Box-Muller_transform

instead of

http://en.wikipedia.org/wiki/Box–Muller_transform
http://en.wikipedia.org/wiki/Box–Muller_transform

I will now use ctrl+l aka the link toolbar button to insert the link:

this is a link to the Wikipedia article

Note that it is properly encoded, etc.

As mentioned in the comments, some browsers also "fix" these oddball characters when copying from the address bar by encoding them on your behalf. A few tests with http://en.wikipedia.org/wiki/Dunning–Kruger_effect produced...

  • Chrome 14: http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  • Firefox 6: http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  • IE 9: http://en.wikipedia.org/wiki/Dunning–Kruger_effect
  • Opera 11.5: http://en.wikipedia.org/wiki/Dunning–Kruger_effect
  • Safari 5.05: http://en.wikipedia.org/wiki/Dunning–Kruger_effect

So Chrome and Firefox have the most desirable behavior here, IMO.

$\endgroup$
  • $\begingroup$ Thanks. I realize they are not required and, in fact, knew this beforehand. However, I raised this issue because it is something specific to this site's functionality. It is reasonable to assume that not all SE users will be up-to-speed on the minutiae of, e.g., RFCs 1738 and 2396 and some that, let's say, have less time or desire to try to unravel these mysteries, will only be frustrated. $\endgroup$ – cardinal Sep 26 '11 at 12:15
  • $\begingroup$ Furthermore, current specifications allow for extended characters to be used in URIs, e.g., some German domains now use umlauts. Here is an example. Interestingly, this does work, yet a copied en-dash does not. $\endgroup$ – cardinal Sep 26 '11 at 12:16
  • 1
    $\begingroup$ I fail to see how it is a good solution to strip characters out of the URI. That's pretty much guaranteed to break it, whereas, if something like a punycode converter were used or a URI encoder, then many (most?) of such problems could be averted. Sorry, I realize this sounds like a rant. For me and many here, your workaround works fine, as long as you catch the broken link within the five-minute time frame and can correct it. In this instance, I failed to double-check the link, my five minutes expired, and I was stuck. :) $\endgroup$ – cardinal Sep 26 '11 at 12:19
  • $\begingroup$ see my edit -- you can use the editor "link" toolbar button or ctrl+l to insert the link as well and it is properly encoded... pasting a "raw" link is the only way this will be an issue. $\endgroup$ – Jeff Atwood Sep 26 '11 at 12:31
  • $\begingroup$ Thanks for the edit, which is helpful. However, my question regards links in comments and, unless I am mistaken, there is no access to either a "link" toolbar or CTRL+L popup functionality from within a comment. :) $\endgroup$ – cardinal Sep 26 '11 at 12:38
  • $\begingroup$ Interestingly, on a Windows XP box running an ancient Firefox 3.5.8, copying a link into the comment box causes the URI-encoded version to be pasted (which gives a working link!), even though the unencoded version is displayed in the browser bar. $\endgroup$ – cardinal Sep 26 '11 at 12:45
  • $\begingroup$ well, comments are second class citizens here. You'll also find that comments with ending parens don't work well in comments either. You can paste "Box–Muller_transform" into meyerweb.com/eric/tools/dencoder to get the encoded version, or just switch to the ASCII version like so: en.wikipedia.org/wiki/Dunning-Kruger_effect $\endgroup$ – Jeff Atwood Sep 26 '11 at 12:46
  • $\begingroup$ FYI, some browsers "fix" this oddball characters in URIs on your behalf when copying links from the address bar. The real fix is for Wikipedia to stop using them, IMHO. It's a bad practice. (I noticed Chrome 14+ also fixes these when I copy from the address bar, too..) $\endgroup$ – Jeff Atwood Sep 26 '11 at 12:47
  • $\begingroup$ I have discovered that the behavior reported above is (also) due to a bug in Firefox 6.0.2. If you copy the link directly from the window into the comment box it is URI encoded (i.e., percent-sign escaped) and so the pasting will work. If, however, you make any edit and then restore it back to the original link within the browser's address bar and then copy and paste, it will no longer be URI encoded. Curious. (I still think SO/SE should have their software URI encode "invalid" characters instead of simply strip them out!) $\endgroup$ – cardinal Sep 27 '11 at 0:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .