From dead96d50530a782ee738938c2c911a44e97bede Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 26 Oct 2014 18:07:28 +0000 Subject: 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. --- chars.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'chars.c') diff --git a/chars.c b/chars.c index a7b34b21..31d75a6e 100644 --- a/chars.c +++ b/chars.c @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.60 2014/10/26 17:12:03 schwarze Exp $ */ +/* $Id: chars.c,v 1.61 2014/10/26 18:07:28 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014 Ingo Schwarze @@ -149,6 +149,17 @@ mchars_spec2str(const struct mchars *arg, return(ln->ascii); } +const char * +mchars_uc2str(int uc) +{ + int i; + + for (i = 0; i < LINES_MAX; i++) + if (uc == lines[i].unicode) + return(lines[i].ascii); + return(""); +} + static const struct ln * find(const struct mchars *tab, const char *p, size_t sz) { -- cgit v1.2.3