Translate characters to arbitrary strings depending on the current font and terminal type.
Use this feature if you want to work with a common standard character set (say ISO8851-latin1) even on terminals that scatter the more unusual characters over several national language font pages.


charset-mapping := designator  template{,mapping}
mapping := char-to-be-mapped template-arg

The braces may be repeated any number of times.

A charset-mapping maps characters in font designator (B: Ascii, A: UK, K: german, etc.) to strings.
mapping describes a single character and the string it is to be translated to.
A template mechanism is used, as most codes have similarities. (for example strings to switch to and from another charset).
Each occurrence of % in template is substituted with the template-arg specified together with the character.
If your strings are not similar use % as a template and place the full string in template-arg.
The \ character "escapes" the special characters \, %, and , .


termcap hp700 'XC=B\E(K%\E(B,\304[,\326\\\\,\334]'
For hp700 terminal, translate ISOlatin1 (charset B) that has a german charset(K
upper-case-umlaut-characters-on-A \304 ; 0xC4; Ä gets translated to \E(K[\E(B and so on.
Note that this line gets parsed *three* times before the internal lookup table is built, therefore a lot of quoting is needed to create a single \.

A mapping that translates the unquoted % char, it will be sent to the terminal whenever screen switches to the corresponding designator.
In this special case the template is assumed to be just % because the charset switch sequence and the character mappings normally haven't much in common.

With xterm, the german (K) charset
\E(B will be sent to the terminal, i.e. the ASCII charset is used instead.
The template is %, so the mapping is straightforward:
[ to \304,
\ to \326, and
] to \334.

termcap xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334'