diff -u groff-1.17.2/src/roff/nroff/nroff.sh.orig groff-1.17.2/src/roff/nroff/nroff.sh --- groff-1.17.2/src/roff/nroff/nroff.sh.orig Tue Jun 4 18:18:46 2002 +++ groff-1.17.2/src/roff/nroff/nroff.sh Tue Jun 4 18:20:51 2002 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh # Emulate nroff with groff. prog="$0" @@ -92,11 +92,28 @@ shift done +# special hack to display Japanese man pages correctly in ja_JP.UTF-8 locale: +ICONV="cat" +case "${LANGUAGE-${LC_ALL-${LC_MESSAGES-${LANG}}}}" in + ja*) + case "`locale charmap 2>/dev/null`" in + UTF-8) + # Japanese man page in UTF-8 locale, special case! + # force the device 'nippon' run groff in ja_JP.eucJP locale + # and convert the result to UTF-8 using iconv: + T=-Tnippon + export LC_ALL=ja_JP.eucJP + ICONV="iconv -f EUC-JP -t UTF-8" + ;; + esac + ;; +esac + # This shell script is intended for use with man, so warnings are # probably not wanted. Also load nroff-style character definitions. : address@hidden@} export GROFF_BIN_PATH -PATH=$GROFF_BIN_PATH:$PATH groff $safer -Wall -mtty-char $T $opts ${1+"$@"} +PATH=$GROFF_BIN_PATH:$PATH groff $safer -Wall -mtty-char $T $opts ${1+"$@"} | $ICONV # eof