+
+ switch (esc) {
+ case ESCAPE_UNICODE:
+ uc = mchars_num2uc(seq + 1, sz - 1);
+ break;
+ case ESCAPE_NUMBERED:
+ uc = mchars_num2char(seq, sz);
+ if (uc < 0)
+ continue;
+ break;
+ case ESCAPE_SPECIAL:
+ if (p->enc == TERMENC_ASCII) {
+ cp = mchars_spec2str(p->symtab,
+ seq, sz, &ssz);
+ if (cp != NULL)
+ encode(p, cp, ssz);
+ } else {
+ uc = mchars_spec2cp(p->symtab, seq, sz);
+ if (uc > 0)
+ encode1(p, uc);
+ }
+ continue;
+ case ESCAPE_FONTBOLD:
+ term_fontrepl(p, TERMFONT_BOLD);
+ continue;
+ case ESCAPE_FONTITALIC:
+ term_fontrepl(p, TERMFONT_UNDER);
+ continue;
+ case ESCAPE_FONTBI:
+ term_fontrepl(p, TERMFONT_BI);
+ continue;
+ case ESCAPE_FONT:
+ /* FALLTHROUGH */
+ case ESCAPE_FONTROMAN:
+ term_fontrepl(p, TERMFONT_NONE);
+ continue;
+ case ESCAPE_FONTPREV:
+ term_fontlast(p);
+ continue;
+ case ESCAPE_NOSPACE:
+ if (TERMP_SKIPCHAR & p->flags)
+ p->flags &= ~TERMP_SKIPCHAR;
+ else if ('\0' == *word)
+ p->flags |= (TERMP_NOSPACE | TERMP_NONEWLINE);
+ continue;
+ case ESCAPE_SKIPCHAR:
+ p->flags |= TERMP_SKIPCHAR;
+ continue;
+ case ESCAPE_OVERSTRIKE:
+ cp = seq + sz;
+ while (seq < cp) {
+ if (*seq == '\\') {
+ mandoc_escape(&seq, NULL, NULL);
+ continue;
+ }
+ encode1(p, *seq++);
+ if (seq < cp)
+ encode(p, "\b", 1);
+ }
+ default:
+ continue;
+ }
+
+ /*
+ * Common handling for Unicode and numbered
+ * character escape sequences.
+ */
+
+ if (p->enc == TERMENC_ASCII) {
+ cp = ascii_uc2str(uc);
+ encode(p, cp, strlen(cp));
+ } else {
+ if ((uc < 0x20 && uc != 0x09) ||
+ (uc > 0x7E && uc < 0xA0))
+ uc = 0xFFFD;
+ encode1(p, uc);
+ }