summaryrefslogtreecommitdiffstats
path: root/term_ascii.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-26 18:07:28 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-26 18:07:28 +0000
commit69c245b0cf5bf2585729fc7e5d9b2957c1a00851 (patch)
tree2121b16bd41fb701624abb6e92d9c079eb85a698 /term_ascii.c
parent769a036f3a9f484327108011e3bfbe984e435947 (diff)
downloadmandoc-69c245b0cf5bf2585729fc7e5d9b2957c1a00851.tar.gz
In -Tascii mode, provide approximations even for some Unicode escape
sequences above codepoint 512 by doing a reverse lookup in the existing mandoc_char(7) character table. Again, groff isn't smart enough to do this and silently discards such escape sequences without printing anything.
Diffstat (limited to 'term_ascii.c')
-rw-r--r--term_ascii.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/term_ascii.c b/term_ascii.c
index d7283411..f5782ff2 100644
--- a/term_ascii.c
+++ b/term_ascii.c
@@ -236,9 +236,11 @@ ascii_uc2str(int uc)
"j", "DZ", "D", "dz", "G", "g", "HV", "W",
"N", "n", "A", "a", "AE", "ae", "O", "o"};
- if (uc < 0 || (size_t)uc >= sizeof(tab)/sizeof(tab[0]))
+ if (uc < 0)
return("<?>");
- return(tab[uc]);
+ if ((size_t)uc < sizeof(tab)/sizeof(tab[0]))
+ return(tab[uc]);
+ return(mchars_uc2str(uc));
}
static size_t