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)

• No a complete solution, but a workaround: [title](link) works just fine. For example: Box-Muller transform – Asaf Karagila Sep 26 '11 at 8:32
• Note that your link does not work. This was my point. :) Should I clarify my question? – cardinal Sep 26 '11 at 8:35
• Yes. You should :-) I will leave the comment, it may be useful for the next user coming around. – Asaf Karagila Sep 26 '11 at 8:36
• @Asaf, you reproduced the exact bug cardinal is mentioning. Nice proof of concept... – Did Sep 26 '11 at 8:36
• @Didier: Would you believe me if I would say this was on purpose? :-P – Asaf Karagila Sep 26 '11 at 8:52
• @Asaf, not quite. Sorry... :-) – Did Sep 26 '11 at 9:06
• If you must, you can percent-encode like so: [Box–Muller transform](http://en.wikipedia.org/wiki/Box%96Muller_transform) gives Box–Muller transform. – J. M. isn't a mathematician Sep 26 '11 at 10:50
• @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. – cardinal Sep 26 '11 at 11:54
• 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. :) – cardinal Sep 26 '11 at 12:23
• @cardinal not a bug. Use the toolbar button or ctrl+l to insert links if this a concern; that is what it is for. – Jeff Atwood Sep 26 '11 at 12:37
• @Jeff: Apparently your interface works different than mine. ;) (Special Jeff-only build?) Neither of those work from a comment box. – cardinal Sep 26 '11 at 12:40
• BTW: the problem is especially acute when pasting in Wolfram Alpha links in comments. That reminds me... – J. M. isn't a mathematician Sep 26 '11 at 12:56

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

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.

• 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. – cardinal Sep 26 '11 at 12:15
• 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. – cardinal Sep 26 '11 at 12:16
• 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. :) – cardinal Sep 26 '11 at 12:19
• 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. – Jeff Atwood Sep 26 '11 at 12:31
• 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. :) – cardinal Sep 26 '11 at 12:38
• 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. – cardinal Sep 26 '11 at 12:45
• 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 – Jeff Atwood Sep 26 '11 at 12:46
• 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..) – Jeff Atwood Sep 26 '11 at 12:47
• 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!) – cardinal Sep 27 '11 at 0:36