views:

353

answers:

3
+7  A: 

It was originally to do with printers. When printing to a old dot matrix printer if you wanted to use italics or select from the 2 or 3 fonts (ie draft, normal or letter quality) you would preceed the command with an ASCII escape character to tell the dot matrix printer not to print the next value and to execute it instead.

Since the advent of Windows this is all handled by the printer drivers but the terminology is still used.

Leo Moore
+2  A: 

I think this is a general term from the telco industry, although I am not sure.

It has to do with in-band signalling: whenever you do in-band signalling, i.e. transfer signalling information on the same channel as your actual user data, then you have a problem: the token(s) that you use to indicate signalling data might also appear in your user data. Escaping is one of several possible ways to overcome this problem (stuffing is another).

Escaping means that you add an additional signalling token to your channel, but one with a very specific meaning: ignore the token itself and also ignore any special meaning that the following token might have.

Of course, computer programs are one example of in-band signalling: computer programs can contain arbitrary strings, but they are themselves also strings.

Although, why exactly these tokens are called "escape" tokens, I have no idea. Maybe it has to do with the fact that they allow you to escape from the signalling interpretation and drop back into the data "non-interpretation".

Jörg W Mittag