groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 03/11: [preconv]: Fix Savannah #62300.


From: G. Branden Robinson
Subject: [groff] 03/11: [preconv]: Fix Savannah #62300.
Date: Tue, 12 Apr 2022 18:42:52 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit a22ceaea8df79608cf31b8080565053c35a0c7cc
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Apr 12 13:19:19 2022 +1000

    [preconv]: Fix Savannah #62300.
    
    * src/preproc/preconv/preconv.cpp (unicode_entity): Convert input U+00A0
      to \~ as troff would, not to \[u00A0].
    
    Fixes <https://savannah.gnu.org/bugs/?62300>.
---
 ChangeLog                       |  7 +++++++
 src/preproc/preconv/preconv.cpp | 10 +++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5ea398ad..03a85e86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-04-12  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/preproc/preconv/preconv.cpp (unicode_entity): Convert
+       input U+00A0 to \~ as troff would, not to \[u00A0].
+
+       Fixes <https://savannah.gnu.org/bugs/?62300>.
+
 2022-04-11  Deri James  <deri@chuzzlewit.myzen.co.uk>
 
        [gropdf] fails to deal with 255th glyph in font.
diff --git a/src/preproc/preconv/preconv.cpp b/src/preproc/preconv/preconv.cpp
index 83feef8f..b1027af1 100644
--- a/src/preproc/preconv/preconv.cpp
+++ b/src/preproc/preconv/preconv.cpp
@@ -404,9 +404,13 @@ unicode_entity(int u)
   if (u < 0x80)
     putchar(u);
   else {
-    // Handle soft hyphen specially -- it is an input character only,
-    // not a glyph.
-    if (u == 0xAD) {
+    // Handle no-break space and soft hyphen specially--they are input
+    // characters only, not glyphs.  See groff_char(7).
+    if (u == 0xA0) {
+      putchar('\\');
+      putchar('~');
+    }
+    else if (u == 0xAD) {
       putchar('\\');
       putchar('%');
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]