source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Flip on printing `?' at Unicode codepoints in -Tascii, -Tpdf,
Date: Tue, 17 May 2011 07:55:08 -0400 (EDT)	[thread overview]
Message-ID: <201105171155.p4HBt8Vm013160@krisdoz.my.domain> (raw)

Log Message:
-----------
Flip on printing `?' at Unicode codepoints in -Tascii, -Tpdf, and -Tps.
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.

Modified Files:
--------------
    mdocml:
        term.c

Revision Data
-------------
Index: term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v
retrieving revision 1.191
retrieving revision 1.192
diff -Lterm.c -Lterm.c -u -p -r1.191 -r1.192
--- term.c
+++ term.c
@@ -451,6 +451,9 @@ term_word(struct termp *p, const char *w
 			break;
 
 		switch (esc) {
+		case (ESCAPE_UNICODE):
+			encode(p, "?", 1);
+			break;
 		case (ESCAPE_NUMBERED):
 			if ('\0' != (c = mchars_num2char(seq, sz)))
 				encode(p, &c, 1);
@@ -584,6 +587,7 @@ term_strlen(const struct termp *p, const
 		for (i = 0; i < rsz; i++)
 			sz += (*p->width)(p, *cp++);
 
+		c = 0;
 		switch (*cp) {
 		case ('\\'):
 			cp++;
@@ -591,8 +595,12 @@ term_strlen(const struct termp *p, const
 			switch (mandoc_escape(&cp, &seq, &ssz)) {
 			case (ESCAPE_ERROR):
 				return(sz);
+			case (ESCAPE_UNICODE):
+				c = '?';
+				/* FALLTHROUGH */
 			case (ESCAPE_NUMBERED):
-				c = mchars_num2char(seq, ssz);
+				if ('\0' != c)
+					c = mchars_num2char(seq, ssz);
 				if ('\0' != c)
 					sz += (*p->width)(p, c);
 				break;
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2011-05-17 11:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201105171155.p4HBt8Vm013160@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).