From amdmi3@amdmi3.ru  Tue Feb 10 16:11:07 2009
Return-Path: <amdmi3@amdmi3.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BD5731065670
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 10 Feb 2009 16:11:07 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 76B678FC26
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 10 Feb 2009 16:11:06 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69)
	(envelope-from <amdmi3@amdmi3.ru>)
	id 1LWvCW-0007Pk-Ft
	for FreeBSD-gnats-submit@freebsd.org; Tue, 10 Feb 2009 19:11:08 +0300
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id 5059AABF4
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 10 Feb 2009 19:10:43 +0300 (MSK)
Received: by hades.panopticon (Postfix, from userid 1000)
	id 1525D108838; Tue, 10 Feb 2009 19:10:48 +0300 (MSK)
Message-Id: <20090210161048.1525D108838@hades.panopticon>
Date: Tue, 10 Feb 2009 19:10:48 +0300 (MSK)
From: Dmitry Marakasov <amdmi3@FreeBSD.org>
Reply-To: Dmitry Marakasov <amdmi3@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [man/groff] don't corrupt man pages by replacing all `-' symbols with unicode 0x2212
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         131562
>Category:       docs
>Synopsis:       [patch] groff(1): don't corrupt man pages by replacing all `-' symbols with unicode 0x2212
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gavin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 10 16:20:01 UTC 2009
>Closed-Date:    Wed Aug 12 15:06:55 UTC 2009
>Last-Modified:  Wed Aug 12 15:06:55 UTC 2009
>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@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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-doc 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Tue Feb 10 17:12:26 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=131562 

From: Anonymous <swell.k@gmail.com>
To: bug-followup@FreeBSD.org,amdmi3@FreeBSD.org
Cc:  
Subject: Re: docs/131562: [patch] groff(1): don't corrupt man pages by replacing all `-' symbols with unicode 0x2212
Date: Fri, 22 May 2009 00:19:45 +0400

 Looks like same workaround as in the patch was applied by r192561[1].
 
 [1] http://docs.FreeBSD.org/cgi/mid.cgi?200905211756.n4LHu0Gf074528
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Wed Aug 12 15:05:55 UTC 2009 
State-Changed-Why:  
Fixed in HEAD and RELENG_7 


Responsible-Changed-From-To: freebsd-doc->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Wed Aug 12 15:05:55 UTC 2009 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=131562 
>Unformatted:
