
Shift Out (SO) andShift In (SI) areASCIIcontrol characters 14 and 15, respectively (0x0E and 0x0F).[1] These are sometimes also called "Control-N" and "Control-O".
The original purpose of these characters was to provide a way to shift a coloured ribbon, split longitudinally usually with red and black, up and down to the other colour in anelectro-mechanicaltypewriter orteleprinter, such as theTeletype 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 differentfont orcharacter set and back. This was used, for instance, in theRussian character set known asKOI7-switched, where SO starts printingRussian letters, and SI starts printingLatin letters again. Similarly, they are used for switching betweenKatakana and Roman letters in the 7-bit version of the JapaneseJIS X 0201.[2][3]
SO/SI control characters also are used to displayVT100pseudographics. Shift In is also used in the 2G variant[4] ofSoftBank Mobile's encoding foremoji.
TheISO/IEC 2022 standard (ECMA-35,JIS X 0202) 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 asLocking Shift One (LS1) andLocking Shift Zero (LS0) in an 8-bit environment, or as SO and SI in a 7-bit environment.[5] In ISO-2022-compliant code sets where the 0x0E and 0x0F characters are used for the purpose of emphasis (such as an italic or red font) rather than a change of character set, they are referred to respectively asUpper Rail (UR) andLower Rail (LR), rather than SO and SI.[6]