The reasoning behind printing SOMETHING at a Unicode codepoint is
because the input is not "wrong" (we suppress printing of "wrong"
things). It's just that ASCII can't handle it.
-/* $Id: term.c,v 1.191 2011/05/15 22:29:50 kristaps Exp $ */
+/* $Id: term.c,v 1.192 2011/05/17 11:55:08 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
+ case (ESCAPE_UNICODE):
+ encode(p, "?", 1);
+ break;
case (ESCAPE_NUMBERED):
if ('\0' != (c = mchars_num2char(seq, sz)))
encode(p, &c, 1);
case (ESCAPE_NUMBERED):
if ('\0' != (c = mchars_num2char(seq, sz)))
encode(p, &c, 1);
for (i = 0; i < rsz; i++)
sz += (*p->width)(p, *cp++);
for (i = 0; i < rsz; i++)
sz += (*p->width)(p, *cp++);
switch (*cp) {
case ('\\'):
cp++;
switch (*cp) {
case ('\\'):
cp++;
switch (mandoc_escape(&cp, &seq, &ssz)) {
case (ESCAPE_ERROR):
return(sz);
switch (mandoc_escape(&cp, &seq, &ssz)) {
case (ESCAPE_ERROR):
return(sz);
+ case (ESCAPE_UNICODE):
+ c = '?';
+ /* FALLTHROUGH */
- c = mchars_num2char(seq, ssz);
+ if ('\0' != c)
+ c = mchars_num2char(seq, ssz);
if ('\0' != c)
sz += (*p->width)(p, c);
break;
if ('\0' != c)
sz += (*p->width)(p, c);
break;