URL:
  <https://savannah.gnu.org/bugs/?67680>

                 Summary: [troff] some special characters still resist
asciification
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Thu 06 Nov 2025 05:52:40 PM UTC
                Category: Core
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 06 Nov 2025 05:52:40 PM UTC By: G. Branden Robinson <gbranden>
Exhibit:


$ cat ATTIC/not_equals.groff 
.sp 1i
.ds label Proof: 1 \[!=] 2
.box DIV
\*[label]
.br
.box
.DIV
.pm DIV
.asciify DIV
.pm DIV
.DIV
.pdfbookmark 1 "\*[DIV]
.pdfbookmark 1 "\*[label]
$ ./build/test-groff -k -ww -T pdf ATTIC/not_equals.groff >|
ATTIC/not_equals.pdf 2>| ATTIC/not_equals.err
$ tail -n 1 ATTIC/not_equals.err
gropdf: warning: Can't convert '!=' to unicode
$ sed '$d' ATTIC/not_equals.err | jq
{
  "name": "DIV",
  "file name": "ATTIC/not_equals.groff",
  "starting line number": 3,
  "length": 16,
  "contents":
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n",
  "node list": [
    {
      "type": "line_start_node",
      "diversion level": 0,
      "is_special_node": false
    },
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "character": "P"
    },
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "character": "r"
    },
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "character": "o"
    },
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "character": "o"
    },
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "character": "f"
    },
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "character": ":"
    },
    {
      "type": "word_space_node",
      "diversion level": 0,
      "is_special_node": false,
      "hunits": 2500,
      "undiscardable": true,
      "is hyphenless breakpoint": false,
      "terminal_color": "default",
      "width_list": [
        {
          "width": 2500,
          "sentence_width": 2500
        }
      ],
      "unformat": false
    },
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "character": "1"
    },
    {
      "type": "word_space_node",
      "diversion level": 0,
      "is_special_node": false,
      "hunits": 2500,
      "undiscardable": true,
      "is hyphenless breakpoint": false,
      "terminal_color": "default",
      "width_list": [
        {
          "width": 2500,
          "sentence_width": 2500
        }
      ],
      "unformat": false
    },
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "special character": "!="
    },
    {
      "type": "word_space_node",
      "diversion level": 0,
      "is_special_node": false,
      "hunits": 2500,
      "undiscardable": true,
      "is hyphenless breakpoint": false,
      "terminal_color": "default",
      "width_list": [
        {
          "width": 2500,
          "sentence_width": 2500
        }
      ],
      "unformat": false
    },
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "character": "2"
    },
    {
      "type": "vertical_size_node",
      "diversion level": 0,
      "is_special_node": false,
      "vunits": -12000
    },
    {
      "type": "vertical_size_node",
      "diversion level": 0,
      "is_special_node": false,
      "vunits": 0
    }
  ]
}
{
  "name": "DIV",
  "file name": "ATTIC/not_equals.groff",
  "starting line number": 9,
  "length": 13,
  "contents": "Proof: 1 \u0000 2\n",
  "node list": [
    {
      "type": "glyph_node",
      "diversion level": 0,
      "is_special_node": false,
      "special character": "!="
    }
  ]
}


1.  We shouldn't still be leaving a node in the asciified diversion.  That
`\u0000` is a killer.  I **suspect**, but don't know for sure, that the PDF
viewer Deri's using in bug #66653 misinterprets the null character as a string
terminator and stops populating the navigation bar.  For me, _okular_,
_evince_, and _xpdf_ just skip over it.

2.  We should throw some kind of warning if we hit a special character we
can't asciify (and say **why** we can't asciify it).

3.  Surely we should be prepared to handle any special character defined in
_groff_char_(7), except for the two undefined by Unicode (`\[bs]\` and
`\[ru]`)







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67680>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to