misc/131562: [man/groff] don't corrupt man pages by replacing all `-' symbols with unicode 0x2212

Dmitry Marakasov amdmi3 at FreeBSD.org
Tue Feb 10 08:20:02 PST 2009


>Number:         131562
>Category:       misc
>Synopsis:       [man/groff] don't corrupt man pages by replacing all `-' symbols with unicode 0x2212
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 10 16:20:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sat Jan 24 06:27:03 UTC 2009 amdmi3 at chrysalis.panopticon:/mnt/usr/obj/mnt/usr/src/sys/HADES i386


>Description:
While formating man pages, groff does replace all `-' (U+002D HYPHEN-MINUS) with `−' (U+2212 MINUS SIGN). This is never correct as command line argument descriptions, mathematical operator descriptions and other stuff become broken and useless for copypasting and search.

The fix attached is a workaround (thanks swell.k at gmail dot com), but that's not enought as there are other cases of symbol corruption.

Examples from `man sh`:

set -E
set ‐E

<&    >&    <<-   >|
<&    >&    <<‐   >|

backquote (``')
backquote (‘‘’) (U+2018 LEFT SINGLE QUOTATION MARK)

I guess the correct fix would be to always use -Tascii for man formatting.

>How-To-Repeat:
man anything with UTF-8 locale
>Fix:

--- R.proto.patch begins here ---
Index: contrib/groff/font/devutf8/R.proto
===================================================================
--- contrib/groff/font/devutf8/R.proto	(revision 186255)
+++ contrib/groff/font/devutf8/R.proto	(working copy)
@@ -726,7 +726,7 @@
 product	24	0	0x220F
 coproduct	24	0	0x2210
 sum	24	0	0x2211
-\-	24	0	0x2212
+\-	24	0	0x002D
 mi	"
 -+	24	0	0x2213
 **	24	0	0x2217
--- R.proto.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list