SI (Shift In) is ASCII code point 15 (0x0F), Unicode U+000F. It is a C0 control character that switched a teleprinter back to its default character set after SO (0x0E) had engaged an alternate one — together they formed the earliest in-band character-set toggle. ISO 2022 formalized this: SO activates the G1 set, SI restores G0, enabling multilingual text on 7-bit links without escape sequences per character. In VT-series terminals, SI/SO toggled between the standard ASCII set and the DEC Special Graphics set used for box-drawing characters. UTF-8 and Unicode largely made this mechanism obsolete, but legacy terminal emulators still honor it. UTF-8 encodes it as the single byte 0x0F; Unicode classifies it as Cc (Control) with the alias SHIFT IN.
unsigned char b = 0x0F; // SI control byteif (b == 0x0F) mode = 0; // back to primary setout[i++] = (mode ? alt_map[x] : x); // render by current mode
SI (ASCII 15) switches the character interpretation back to the default set after a Shift Out. Think of it as pressing the 'normal' button — it tells the output device to stop using an alternate character set and return to standard ASCII.
SO (ASCII 14) activates an alternate character set — like switching to bold, italic, or a different language on a printer. SI switches back. Together they act like toggle brackets: SO says 'start alternate mode,' SI says 'end alternate mode.'
They appear in ISO-2022 character encoding, which uses SO/SI to switch between ASCII and other scripts (like Japanese JIS). Some legacy terminals and mainframe systems also use them. Modern Unicode has largely eliminated the need for character set switching.
If you're working with ISO-2022 encoded text (common in Japanese email systems), SI/SO are meaningful and must be handled correctly. For everything else, strip them as non-printable control characters during sanitization.