DC2 (Device Control 2) is ASCII code point 18 (0x12), Unicode U+0012. It is a C0 control character that originally toggled an auxiliary device — typically a paper tape punch — into an active state on teleprinter setups. Unlike DC1/DC3 (XON/XOFF), DC2 never acquired a universal standard meaning, so its function was always vendor-defined. IBM 2741 terminals used it to shift into an alternate character set, and some receipt printers still map 0x12 to "start emphasized printing" in ESC/POS command sequences. In practice, DC2 appears in the wild far less than its neighbors, making it a byte most modern parsers silently pass through or discard. UTF-8 encodes it as the single byte 0x12; Unicode classifies it as Cc (Control) with the alias DEVICE CONTROL TWO.
unsigned char dc2 = 0x12; // ASCII 18 (DC2)unsigned char frame[] = {0x02, dc2, 0x31, 0x03}; // STX, DC2, '1', ETXint is_dc2 = (frame[1] == dc2); // detect control byte
DC2 (ASCII 18) is a generic device control character without a fixed meaning. Unlike DC1 (XON) and DC3 (XOFF), which became standard flow control signals, DC2 was left flexible so different devices could assign it their own function.
Each manufacturer decided. On some printers, DC2 meant 'start condensed mode.' On certain terminals, it toggled a secondary function. The lack of standardization means DC2's behavior is entirely context-dependent — you need the device manual to know what it does.
Unlikely, unless you work with legacy industrial equipment, point-of-sale systems, or serial devices that follow older protocols. In mainstream software, DC2 is just another byte to filter out when sanitizing control characters from text.
Ctrl+R generates DC2 (ASCII 18). In most modern terminals, Ctrl+R is intercepted for reverse-search (bash/zsh) before the raw byte reaches any program, so you'll rarely see the actual DC2 character.