Skip to main content

Forums » Suggestions & Development Discussion » Why you can't use \ on the forums

Kim Site Admin

This question has been coming up so often recently, that I'm making a general post so more people know the answer. :)

Backslashes are used to "escape" special characters that might have actual programmatical meaning when information is sent from place to place to prevent accidental errors and certain kinds of malicious hacking.

You've likely been to a forum or seen a page where every time quotes were used there'd be mysterious backslashes inserted before them. For example:

\"Hello I'm obviously a weird error that keeps popping up,\" said the weird error that kept popping up. \"Don't I look awful?\"

It's a safety precaution that has to come back out before it's displayed for human consumption. So to prevent backslashes from glomming on to all of your punctuation, backslashes are stripped out after the data has arrived safely, and the characters that might cause issues are rendered harmless. Quotes are in fact one of them that can be used maliciously in skilled, evil hands, which is why you normally see backslashes appear on them in situations where the programmer doesn't have their ducks in a row.

It used to be that backslashes never occurred in natural conversation, so no one knew that they were being added and no one missed them when they were taken back out. Modern emoticons are creating complications.

It is not possible to safely treat a lone backslash as anything other than an escape character, because when a post is sent to us we can't tell whether YOU wrote the backslash, or the server threw it on to protect itself.

That said, backslash is an escape character with the power to escape itself. If you want one to appear, type two. When you write \\, what you are effectively saying with the first backslash is "treat the character that immediately follows me as literal. Do not allow it to have any programmatical meaning." And if the next character happens to be a backslash, ta-da, it will be transformed into a normal backslash rather than a masked keeper of the peace.

And yes, I had to type four backslashes to display two to you.

Why backslashes cause errors to appear in the chat is a more complicated matter, but still intimately related to the security functions of backslashes. I'm working on a patch to prevent the chat from freaking out about it.

EDIT: Backslashes should no longer cause errors in the chat. You do still have to escape them to make them appear, though.

You are on: Forums » Suggestions & Development Discussion » Why you can't use \ on the forums

Moderators: Mina, Keke, Cass, Auberon, Claine, Ilmarinen, Ben, Darth_Angelus