Subject: Re: [PATCH] Try URI quoting for embedded TAB and LF in pathnames

From: "H. Peter Anvin" <[email-masked]>
Date: Wed, 12 Oct 2005 13:21:03 -0700

Linus Torvalds wrote:
> 
> Nope. The traditional vt100 escape sequence is "ESC" followed by a 
> character to indicate the type of sequence (the most common one is '['). 
> That's all 7-bit and fine.
> 
> HOWEVER, they made the 8-bit extension be such that any of these vt100 
> begin sequences where the second character is in the appropriate range can 
> be instead shortened by one character, by instead using a single 8-bit 
> character of "0x80+(char-0x40)". Ie the traditional "ESC + '['" (\x1b\x5b) 
> can also be written as a single '\x9b' character, aka CSI.
> 
> In other words, 0x80-0x9f are _all_ just vt100 shorthand for ESC+'@' 
> through ESC+'_'.
> 
> (I guess it's not strictly "vt100" any more - it's the extended vt220 
> format).
> 

Actually, it's even trickier than that.

CSI is character 0x1b of control code set C1; there are two "windows" 
for control codes -- CL (0x00-0x1f) and CR (0x80-0x9f).  Normally CL is 
mapped to C0 and CR is mapped to CL, but ESC will temporarily map C1 
into CL.

VT1xx didn't support this since they didn't support 8-bit anything.

Anyway, a *lot* of character sets -- not just UTF-8 -- use the CR range 
of bytes for printables.

	-hpa