\x0b
is the U+000B, LINE TABULATION, and \x0c
is U+000C, FORM FEED (FF).
Great. What does that mean, and why are they considered printable?
Back in the days of teletypes, ASCII provided these characters for advancing a sheet of paper through the printer. The line tabulation character was to a line feed like a horizontal tab was to a space. The printer could have a set of defined vertical tab stops, and a line tabulation character would be interpreted as a request to advance to the next one following the current line.
A form feed would advance to the top of the next page, however the device defined a page. (If it used a continuous paper feed, a "page" would be considered, say, 66 lines, and if you were currently on line 60, a form feed would simply advance 7 lines, to line 1 of the next page.)
On a modern terminal emulator, they tend not to have any particular meaning. Simple tests indicate that on an xterm
, they both appear to be treated the same as a line feed followed by a space:
>>> print("x\x0cy")
x
y
>>> print("x\x0by")
x
y
>>>
Update: after seeing https://stackoverflow.com/a/58421132/1126841, it would appear isn't not just a space following the line feed, but rather a line feed not followed by a carriage return, i.e., the cursor advances one line without returning to the beginning of that line; compare with print("\n")
, which advances to the beginning of the next line, regardless of where the cursor currently is. (That makes more sense, and I should have remembered that.)