Bug 154822 - groff_mdoc UTF-8 issue
Summary: groff_mdoc UTF-8 issue
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: gnu (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ulrich Spoerlein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-16 14:40 UTC by kamikaze
Modified: 2011-06-08 09:10 UTC (History)
0 users

See Also:


Attachments
file.diff (360 bytes, patch)
2011-02-16 14:40 UTC, kamikaze
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kamikaze 2011-02-16 14:40:09 UTC
The Aq macro of the doc definition, see groff_mdoc(7), encloses e-mail addresses with angle brackets, like <kamikaze@bsdforen.de>.

With a UTF-8 locale like en_GB.UTF-8, it uses a less wide, em-high set of angle brackets for this.
While technically correct two issues turn this into a problem. Many fonts do not define that character, resulting in broken output in your terminal emulator of choice. The second problem is that e-mail programs do not recognize the character as an angle bracket.

The ASCII compatible <> are understood by e-mail programs, allowing simple copy'n'paste(TM) from manual pages, which is no longer possible when using different angle bracket characters.

Fix: I propose changing the specification of the Aq macro, not very elegant, but it works.

Patch attached with submission follows:
How-To-Repeat: env LANG=C man geom
env LANG=en_US.UTF-8 geom

Jump to the AUTHORS section.
Comment 1 Ulrich Spoerlein freebsd_committer 2011-02-20 13:40:55 UTC
Responsible Changed
From-To: freebsd-bugs->uqs

I'll take it.
Comment 2 dfilter service freebsd_committer 2011-03-02 21:59:56 UTC
Author: uqs
Date: Wed Mar  2 21:59:42 2011
New Revision: 219209
URL: http://svn.freebsd.org/changeset/base/219209

Log:
  Unbreak .Aq for non-ASCII output like -Tps or -Tutf8.
  
  groff will try to produce fancy angle brackets like
  	Foo â¨foo@FreeBSD.orgâ©
  This is nice and well, but no email client will understand them. For
  ease of copy&paste keep the one-true pair of brackets 0x3c/0x3e.
  
  See:		RFC 822, RFC 2822
  PR:		gnu/154822
  Submitted by:	Dominic Fandrey <kamikaze@bsdforen.de>
  MFC after:	2 weeks

Modified:
  head/contrib/groff/tmac/doc.tmac

Modified: head/contrib/groff/tmac/doc.tmac
==============================================================================
--- head/contrib/groff/tmac/doc.tmac	Wed Mar  2 21:51:22 2011	(r219208)
+++ head/contrib/groff/tmac/doc.tmac	Wed Mar  2 21:59:42 2011	(r219209)
@@ -1197,8 +1197,8 @@
 .  if !\n[doc-arg-limit] \
 .    ds doc-macro-name Aq
 .
-.  ds doc-quote-left \[la]
-.  ds doc-quote-right \[ra]
+.  ds doc-quote-left <
+.  ds doc-quote-right >
 .
 .  doc-enclose-string \$@
 ..
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 3 Ulrich Spoerlein freebsd_committer 2011-03-02 22:00:37 UTC
State Changed
From-To: open->patched

Patched in head, awaiting MFC
Comment 4 dfilter service freebsd_committer 2011-03-24 17:09:36 UTC
Author: uqs
Date: Thu Mar 24 17:09:24 2011
New Revision: 219965
URL: http://svn.freebsd.org/changeset/base/219965

Log:
  MFH r219209: Unbreak .Aq for non-ASCII output like -Tps or -Tutf8.
  
  PR:		gnu/154822
  Submitted by:	Dominic Fandrey <kamikaze@bsdforen.de>

Modified:
  stable/8/contrib/groff/tmac/doc.tmac
Directory Properties:
  stable/8/contrib/groff/   (props changed)

Modified: stable/8/contrib/groff/tmac/doc.tmac
==============================================================================
--- stable/8/contrib/groff/tmac/doc.tmac	Thu Mar 24 16:56:33 2011	(r219964)
+++ stable/8/contrib/groff/tmac/doc.tmac	Thu Mar 24 17:09:24 2011	(r219965)
@@ -1197,8 +1197,8 @@
 .  if !\n[doc-arg-limit] \
 .    ds doc-macro-name Aq
 .
-.  ds doc-quote-left \[la]
-.  ds doc-quote-right \[ra]
+.  ds doc-quote-left <
+.  ds doc-quote-right >
 .
 .  doc-enclose-string \$@
 ..
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 5 dfilter service freebsd_committer 2011-03-24 17:09:53 UTC
Author: uqs
Date: Thu Mar 24 17:09:37 2011
New Revision: 219966
URL: http://svn.freebsd.org/changeset/base/219966

Log:
  MFH r219209: Unbreak .Aq for non-ASCII output like -Tps or -Tutf8.
  
  PR:             gnu/154822
  Submitted by:   Dominic Fandrey <kamikaze@bsdforen.de>

Modified:
  stable/7/contrib/groff/tmac/doc.tmac
Directory Properties:
  stable/7/contrib/groff/   (props changed)

Modified: stable/7/contrib/groff/tmac/doc.tmac
==============================================================================
--- stable/7/contrib/groff/tmac/doc.tmac	Thu Mar 24 17:09:24 2011	(r219965)
+++ stable/7/contrib/groff/tmac/doc.tmac	Thu Mar 24 17:09:37 2011	(r219966)
@@ -1197,8 +1197,8 @@
 .  if !\n[doc-arg-limit] \
 .    ds doc-macro-name Aq
 .
-.  ds doc-quote-left \[la]
-.  ds doc-quote-right \[ra]
+.  ds doc-quote-left <
+.  ds doc-quote-right >
 .
 .  doc-enclose-string \$@
 ..
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 6 Ulrich Spoerlein freebsd_committer 2011-03-24 17:35:21 UTC
State Changed
From-To: patched->closed

Merged to stable branches.
Comment 7 dfilter service freebsd_committer 2011-06-08 09:08:56 UTC
Author: ru
Date: Wed Jun  8 08:08:42 2011
New Revision: 222852
URL: http://svn.freebsd.org/changeset/base/222852

Log:
  Pull up all vendor changes to mdoc(7).
  
  This also replaces the local fix in r219209 that made .Ac emit
  ASCII angle quotes with an official fix.  In the official fix,
  ASCII quotes are output when using the .Aq, .Ao and .Ac calls,
  but only when nested into the .An macro.
  
  PR:		gnu/154822

Modified:
  head/contrib/groff/tmac/doc-common
  head/contrib/groff/tmac/doc-syms
  head/contrib/groff/tmac/doc.tmac
  head/gnu/usr.bin/groff/tmac/mdoc.local

Modified: head/contrib/groff/tmac/doc-common
==============================================================================
--- head/contrib/groff/tmac/doc-common	Wed Jun  8 04:57:14 2011	(r222851)
+++ head/contrib/groff/tmac/doc-common	Wed Jun  8 08:08:42 2011	(r222852)
@@ -543,6 +543,7 @@
 .ds doc-operating-system-FreeBSD-7.3     7.3
 .ds doc-operating-system-FreeBSD-8.0     8.0
 .ds doc-operating-system-FreeBSD-8.1     8.1
+.ds doc-operating-system-FreeBSD-8.2     8.2
 .
 .ds doc-operating-system-Darwin-8.0.0  8.0.0
 .ds doc-operating-system-Darwin-8.1.0  8.1.0
@@ -563,6 +564,17 @@
 .ds doc-operating-system-Darwin-9.4.0  9.4.0
 .ds doc-operating-system-Darwin-9.5.0  9.5.0
 .ds doc-operating-system-Darwin-9.6.0  9.6.0
+.ds doc-operating-system-Darwin-9.7.0  9.7.0
+.ds doc-operating-system-Darwin-9.8.0  9.8.0
+.ds doc-operating-system-Darwin-10.6.0 10.6.0
+.ds doc-operating-system-Darwin-10.1.0 10.1.0
+.ds doc-operating-system-Darwin-10.2.0 10.2.0
+.ds doc-operating-system-Darwin-10.3.0 10.3.0
+.ds doc-operating-system-Darwin-10.4.0 10.4.0
+.ds doc-operating-system-Darwin-10.5.0 10.5.0
+.ds doc-operating-system-Darwin-10.6.0 10.6.0
+.ds doc-operating-system-Darwin-10.7.0 10.7.0
+.ds doc-operating-system-Darwin-11.0.0 11.0.0
 .
 .ds doc-operating-system-DragonFly-1.0    1.0
 .ds doc-operating-system-DragonFly-1.1    1.1

Modified: head/contrib/groff/tmac/doc-syms
==============================================================================
--- head/contrib/groff/tmac/doc-syms	Wed Jun  8 04:57:14 2011	(r222851)
+++ head/contrib/groff/tmac/doc-syms	Wed Jun  8 08:08:42 2011	(r222852)
@@ -617,6 +617,8 @@
 .\" POSIX Part 1: System API
 .ds doc-str-St--p1003.1        \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1
 .as doc-str-St--p1003.1        " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
+.ds doc-str-St--p1003.1b       \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1b
+.as doc-str-St--p1003.1b       " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
 .ds doc-str-St--p1003.1-88     \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1-1988
 .as doc-str-St--p1003.1-88     " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
 .ds doc-str-St--p1003.1-90     \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9945-1:1990
@@ -754,6 +756,7 @@
 .
 .ds doc-str-Lb-libarm      ARM Architecture Library (libarm, \-larm)
 .ds doc-str-Lb-libarm32    ARM32 Architecture Library (libarm32, \-larm32)
+.ds doc-str-Lb-libbsm      Basic Security Module Library (libbsm, \-lbsm)
 .ds doc-str-Lb-libc        Standard C\~Library (libc, \-lc)
 .ds doc-str-Lb-libcdk      Curses Development Kit Library (libcdk, \-lcdk)
 .ds doc-str-Lb-libcompat   Compatibility Library (libcompat, \-lcompat)
@@ -779,6 +782,7 @@
 .ds doc-str-Lb-libpthread  \*[Px] \*[doc-str-Lb]Threads Library (libpthread, \-lpthread)
 .ds doc-str-Lb-libresolv   DNS Resolver Library (libresolv, \-lresolv)
 .ds doc-str-Lb-librt       \*[Px] \*[doc-str-Lb]Real-time Library (librt, \-lrt)
+.ds doc-str-Lb-libSystem   System Library (libSystem, \-lSystem)
 .ds doc-str-Lb-libtermcap  Termcap Access Library (libtermcap, \-ltermcap)
 .ds doc-str-Lb-libusbhid   USB Human Interface Devices Library (libusbhid, \-lusbhid)
 .ds doc-str-Lb-libutil     System Utilities Library (libutil, \-lutil)

Modified: head/contrib/groff/tmac/doc.tmac
==============================================================================
--- head/contrib/groff/tmac/doc.tmac	Wed Jun  8 04:57:14 2011	(r222851)
+++ head/contrib/groff/tmac/doc.tmac	Wed Jun  8 08:08:42 2011	(r222852)
@@ -1197,8 +1197,14 @@
 .  if !\n[doc-arg-limit] \
 .    ds doc-macro-name Aq
 .
-.  ds doc-quote-left <
-.  ds doc-quote-right >
+.  ie "\*[doc-macro-name]"An" \{\
+.    ds doc-quote-left <
+.    ds doc-quote-right >
+.  \}
+.  el \{\
+.    ds doc-quote-left \[la]
+.    ds doc-quote-right \[ra]
+.  \}
 .
 .  doc-enclose-string \$@
 ..
@@ -1527,7 +1533,10 @@
 .  if !\n[doc-arg-limit] \
 .    ds doc-macro-name Ao
 .
-.  ds doc-quote-left \[la]
+.  ie "\*[doc-macro-name]"An" \
+.    ds doc-quote-left <
+.  el \
+.    ds doc-quote-left \[la]
 .
 .  doc-enclose-open \$@
 ..
@@ -1546,7 +1555,10 @@
 .  if !\n[doc-arg-limit] \
 .    ds doc-macro-name Ac
 .
-.  ds doc-quote-right \[ra]
+.  ie "\*[doc-macro-name]"An" \
+.    ds doc-quote-right >
+.  el \
+.    ds doc-quote-right \[ra]
 .
 .  doc-enclose-close \$@
 ..

Modified: head/gnu/usr.bin/groff/tmac/mdoc.local
==============================================================================
--- head/gnu/usr.bin/groff/tmac/mdoc.local	Wed Jun  8 04:57:14 2011	(r222851)
+++ head/gnu/usr.bin/groff/tmac/mdoc.local	Wed Jun  8 08:08:42 2011	(r222852)
@@ -34,7 +34,6 @@
 .\" FreeBSD .Lb values
 .ds doc-str-Lb-libarchive  Streaming Archive Library (libarchive, \-larchive)
 .ds doc-str-Lb-libbluetooth Bluetooth User Library (libbluetooth, \-lbluetooth)
-.ds doc-str-Lb-libbsm      Basic Security Module User Library (libbsm, \-lbsm)
 .ds doc-str-Lb-libc_r      Reentrant C\~Library (libc_r, \-lc_r)
 .ds doc-str-Lb-libcalendar Calendar Arithmetic Library (libcalendar, \-lcalendar)
 .ds doc-str-Lb-libcam      Common Access Method User Library (libcam, \-lcam)
@@ -75,7 +74,6 @@
 .
 .\" FreeBSD releases not found in doc-common
 .ds doc-operating-system-FreeBSD-7.4    7.4
-.ds doc-operating-system-FreeBSD-8.2    8.2
 .ds doc-operating-system-FreeBSD-9.0    9.0
 .
 .\" Definitions not (yet) in doc-syms
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"