1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! Character-set designation and locking-shift sequences.
//!
//! ## Category
//!
//! This module emits SCS (`ESC` plus a G-set selector and charset designator)
//! and the locking-shift controls that map G1/G2/G3 into GL or GR.
//!
//! ## Escape format
//!
//! SCS is a short 7-bit ESC sequence rather than CSI/OSC/DCS:
//!
//! ```text
//! ESC ( B
//! ─┬─ ┬ ┬
//! intro G0 charset
//! ```
//!
//! The caller supplies the G-set selector byte and charset identifier exactly as
//! they should appear on the wire.
//!
//! ## Mode interaction
//!
//! Charset selection affects how subsequent bytes are rendered by terminals that
//! honor ISO-2022 character sets. It is independent of DECSET/DECRST modes.
use ;
/// Designate a character set with `ESC <gset> <charset>`.
///
/// `gset` is the designator selector byte: `b'('`/`b')'`/`b'*'`/`b'+'` for G0-G3 94-character sets, or `b'-'`/`b'.'`/`b'/'` for G1-G3 96-character sets. `charset` is emitted as the final designator byte, for example `b'B'` or `b'0'`.
/// Lock G1 into GR: exact bytes `ESC ~`.
///
/// Use after designating G-sets with [`write_select_charset`] when a terminal honors ISO-2022 locking shifts.
pub const LS1R: & = b"\x1b~";
/// Lock G2 into GL: exact bytes `ESC n`.
///
/// Use after designating G-sets with [`write_select_charset`] when a terminal honors ISO-2022 locking shifts.
pub const LS2: & = b"\x1bn";
/// Lock G2 into GR: exact bytes `ESC }`.
///
/// Use after designating G-sets with [`write_select_charset`] when a terminal honors ISO-2022 locking shifts.
pub const LS2R: & = b"\x1b}";
/// Lock G3 into GL: exact bytes `ESC o`.
///
/// Use after designating G-sets with [`write_select_charset`] when a terminal honors ISO-2022 locking shifts.
pub const LS3: & = b"\x1bo";
/// Lock G3 into GR: exact bytes `ESC |`.
///
/// Use after designating G-sets with [`write_select_charset`] when a terminal honors ISO-2022 locking shifts.
pub const LS3R: & = b"\x1b|";