Bug 1462642 - groff: .UR and .MT -man commands produce syntactically incorrect mail addresses
groff: .UR and .MT -man commands produce syntactically incorrect mail addresses
Status: NEW
Product: Fedora
Classification: Fedora
Component: groff (Show other bugs)
27
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Nikola Forró
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-19 02:53 EDT by Florian Weimer
Modified: 2017-08-15 03:29 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1462452
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Florian Weimer 2017-06-19 02:53:40 EDT
+++ This bug was initially created as a clone of Bug #1462452 +++

Description of problem:
/usr/share/man/man1/fallocate.1.gz uses constructs like 

.UR user@host
name

that are supposed to generate "name <user@host>".

If the locale encoding is not US-ASCII, man will tell groff to generate UTF-8 output (see bug 1462448). Then groff will use UTF-8 sequences e2 9f a8 (MATHEMATICAL LEFT ANGLE BRACKET) and e2 9f a9 (MATHEMATICAL RIGHT ANGLE BRACKET) around user@host. man then runs iconv to transliterate those utf-8 sequences to the locale charset. However, this fails, since iconv does not know that e2 9f a8 can be transliterated to "<" and e2 9f a9 to ">".

Version-Release number of selected component (if applicable):
glibc-2.24-6.fc25.i686

How reproducible:
always

Steps to Reproduce:
1. LANG=en_US man fallocate | iconv -f latin1

Actual results:
AUTHORS
       Eric Sandeen ?sandeen@redhat.com?
       Karel Zak ?kzak@redhat.com?

SEE ALSO
       fallocate(2), posix_fallocate(3), truncate(1)

AVAILABILITY
       The  fallocate  command is part of the util-linux package and is avail-
       able from Linux  Kernel  Archive  ?ftp://ftp.kernel.org/pub/linux/utils
       /util-linux/?.


Expected results:
AUTHORS
       Eric Sandeen <sandeen@redhat.com>
       Karel Zak <kzak@redhat.com>

SEE ALSO
       fallocate(2), posix_fallocate(3), truncate(1)

AVAILABILITY
       The  fallocate  command is part of the util-linux package and is avail-
       able from Linux  Kernel  Archive  <ftp://ftp.kernel.org/pub/linux/utils
       /util-linux/>.


Additional info:
bug 1462448 proposes changes to man that prevent this problem in latin1 and IBM-1047, but transliteration will still be necessary for other charsets and those should be supported too.

--- Additional comment from Carlos O'Donell on 2017-06-19 03:56:31 CEST ---

The language and locale neutral transliterations don't have any entries for the mathematical angle brackets. We need a mapping to be added.

diff --git a/localedata/locales/translit_neutral b/localedata/locales/translit_neutral
index e3639c0..d094630 100644
--- a/localedata/locales/translit_neutral
+++ b/localedata/locales/translit_neutral
@@ -743,6 +743,10 @@ include "translit_wide";""
 <U263A> "<U003A><U0029>"
 % BLACK SMILING FACE
 <U263B> "<U003A><U0029>"
+% MATHEMATICAL LEFT ANGLE BRACKET
+<U27E8> <U003C>
+% MATHEMATICAL RIGHT ANGLE BRACKET
+<U27E9> <U003E>
 % MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET⟫
 <U27EB> "<U003E><U003E>"
 % MATHEMATICAL LEFT DOUBLE ANGLE BRACKET
---

Something like this needs to go upstream first.

--- Additional comment from Florian Weimer on 2017-06-19 08:52:06 CEST ---

The .UR macro behavior is very questionable anyway because it means that you cannot cut-and-paste an email address into a mail client, which requires ASCII angle brackets.  This is even a problem if the terminal is UTF-8, and the glibc transliteration change would not fix this.  The .MT command produces such misformatted addresses, too.
Comment 1 Jan Kurik 2017-08-15 03:29:55 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Note You need to log in before you can comment on or make changes to this bug.