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. --- term_ascii.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'term_ascii.c') diff --git a/term_ascii.c b/term_ascii.c index 64f9f686..1b3040a0 100644 --- a/term_ascii.c +++ b/term_ascii.c @@ -1,4 +1,4 @@ -/* $Id: term_ascii.c,v 1.34 2014/10/26 17:12:03 schwarze Exp $ */ +/* $Id: term_ascii.c,v 1.35 2014/10/26 18:07:28 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -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 -- cgit v1.2.3-56-ge451