bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nroff does not honor TYPESETTER


From: Michael G Schwern
Subject: nroff does not honor TYPESETTER
Date: Sun, 18 Nov 2007 17:54:17 -0800
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)

                           Groff Bug Report

Please read the PROBLEMS file before sending in a bug report.

Please fill in all fields, even if you think they are not relevant.

Please delete the text in brackets before sending it in.

Please report separate bugs separately.

Send the completed form to address@hidden

GROFF VERSION:
1.19.2

MACHINE:
Macbook1,1

OS:
OS X 10.4.11

COMPILER:
i686-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)

INPUT FILES:

COMMAND LINE:
echo "\& 'something'" | TYPESETTER=ascii LC_CTYPE=en_US.UTF-8 nroff

DESCRIPTION OF INCORRECT BEHAVIOUR:
nroff does not honor the TYPESETTER environment variable documented in the
"Troff User's Manual" page 31.  The result should be 'something' in ASCII with
no Unicode quotes, just as if nroff were run with -Tascii.  Instead groff
translates the quotes to x2019 Unicode single quotes using the utf8 device.

SUGGESTED FIX [optional]:
If the TYPESETTER environment variable is set, use it rather than guess based
on the locale.

Additionally, I wouldn't be upset if groff stopped mapping ASCII input
characters into Unicode.  It often results in mangled example code when code
has been translated into nroff with imperfect escaping.  The problem I hit was
perl's pod2man utility.

Most of this patch is reindenting the case statement.  There's probably a
better way to implement this, but I'm not a shell programmer.

--- src/roff/nroff/nroff.sh     (revision 40857)
+++ src/roff/nroff/nroff.sh     (local)
@@ -3,37 +3,44 @@

 prog="$0"
 # Default device.
-# First try the "locale charmap" command, because it's most reliable.
+# First check the TYPESETTER environment variable.  Then figure it out
+# by the locale.
+if [ $TYPESETTER ]; then
+  T=-T$TYPESETTER
+
+# Try the "locale charmap" command first, because it's most reliable.
 # On systems where it doesn't exist, look at the environment variables.
-case "`exec 2>/dev/null ; locale charmap`" in
-  UTF-8)
-    T=-Tutf8 ;;
-  ISO-8859-1 | ISO-8859-15)
-    T=-Tlatin1 ;;
-  IBM-1047)
-    T=-Tcp1047 ;;
-  *)
-    case "${LC_ALL-${LC_CTYPE-${LANG}}}" in
-      *.UTF-8)
-        T=-Tutf8 ;;
-      iso_8859_1 | *.ISO-8859-1 | *.ISO8859-1 | \
-      iso_8859_15 | *.ISO-8859-15 | *.ISO8859-15)
-        T=-Tlatin1 ;;
-      *.IBM-1047)
-        T=-Tcp1047 ;;
-      *)
-        case "$LESSCHARSET" in
-          utf-8)
-            T=-Tutf8 ;;
-          latin1)
-            T=-Tlatin1 ;;
-          cp1047)
-            T=-Tcp1047 ;;
-          *)
-            T=-Tascii ;;
-          esac ;;
-     esac ;;
-esac
+else
+  case "`exec 2>/dev/null ; locale charmap`" in
+    UTF-8)
+      T=-Tutf8 ;;
+    ISO-8859-1 | ISO-8859-15)
+      T=-Tlatin1 ;;
+    IBM-1047)
+      T=-Tcp1047 ;;
+    *)
+      case "${LC_ALL-${LC_CTYPE-${LANG}}}" in
+        *.UTF-8)
+          T=-Tutf8 ;;
+        iso_8859_1 | *.ISO-8859-1 | *.ISO8859-1 | \
+        iso_8859_15 | *.ISO-8859-15 | *.ISO8859-15)
+          T=-Tlatin1 ;;
+        *.IBM-1047)
+          T=-Tcp1047 ;;
+        *)
+          case "$LESSCHARSET" in
+            utf-8)
+              T=-Tutf8 ;;
+            latin1)
+              T=-Tlatin1 ;;
+            cp1047)
+              T=-Tcp1047 ;;
+            *)
+              T=-Tascii ;;
+            esac ;;
+       esac ;;
+  esac
+fi
 opts=

 # `for i; do' doesn't work with some versions of sh


-- 
Just call me 'Moron Sugar'.
        http://www.somethingpositive.net/sp05182002.shtml





reply via email to

[Prev in Thread] Current Thread [Next in Thread]