2 # Emulate nroff with groff.
6 charset_out=`locale charmap 2>/dev/null`
16 -[eq] | -s* | -u* | -T* )
17 # ignore these options
20 echo "option $1 requires an argument" >&2
25 echo "GNU nroff (groff) with Red Hat i18n/l10n support"
31 echo "usage: $prog [-cChipt] [-mNAME] [-nNUM] [--legacy CHARSET] [-oLIST] [-rCN] [FILE...]"
39 echo "$prog: invalid option $1" >&2
47 TMPFILE=$(mktemp /tmp/man.XXXXXX)
48 trap "rm -f $TMPFILE" 0 1 2 3 15
50 cat ${1+"$@"} >| ${TMPFILE}
52 if iconv -f utf-8 -t utf-8 -o /dev/null ${TMPFILE} 2>/dev/null
57 # en_US is chosen arbitrarily; any UTF-8 locale should work
61 # This shell script is intended for use with man, so warnings are
62 # probably not wanted. Also load nroff-style character definitions.
64 /usr/bin/iconv -f ${charset_in} -t utf-8 ${TMPFILE} | \
65 /usr/bin/groff -mtty-char -Tutf8 $opts 2>/dev/null | \
66 /usr/bin/iconv -f utf-8 -t ${charset_out}//translit