Shift Out and Shift In characters


Shift Out and Shift In are ASCII control characters 14 and 15, respectively. These are sometimes also called "Control-N" and "Control-O".
The original meaning of those characters provided a way to shift a coloured ribbon, split longitudinally usually with red and black, up and down to the other colour in an electro-mechanical typewriter or teleprinter, such as the Teletype Model 38, to automate the same function of manual typewriters. Black was the conventional ambient default colour and so was shifted "in" or "out" with the other colour on the ribbon.
Later advancements in technology instigated use of this function for switching to a different font or character set and back. This was used, for instance, in the Russian character set known as KOI7-switched, where SO starts printing Russian letters, and SI starts printing Latin letters again. Similarly, they are used for switching between Katakana and Roman letters in the 7-bit version of the Japanese JIS X 0201.
SO/SI control characters also are used to display VT-100 pseudographics. Shift In is also used in the 2G variant of SoftBank Mobile's encoding for emoji.
The ISO/IEC 2022 standard standardises the generalized usage of SO and SI for switching between pre-designated character sets invoked over the 0x20–0x7F byte range. It refers to them respectively as Locking Shift One and Locking Shift Zero in an 8-bit environment, or as SO and SI in a 7-bit environment. In ISO-2022-compliant code sets where the 0x0E and 0x0F characters are used for the purpose of emphasis rather than a change of character set, they are referred to respectively as Upper Rail and Lower Rail, rather than SO and SI.