Bugzilla – Attachment 64580 Details for
Bug 144726
bad codepages for russian man pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
utf8.patch
utf8.patch (text/plain), 3.71 KB, created by
Mike Fabian
on 2006-01-23 17:40:21 UTC
(
hide
)
Description:
utf8.patch
Filename:
MIME Type:
Creator:
Mike Fabian
Created:
2006-01-23 17:40:21 UTC
Size:
3.71 KB
patch
obsolete
>--- groff-1.18.1.1/src/roff/nroff/nroff.sh.utf-8 2006-01-23 18:25:46.000000000 +0100 >+++ groff-1.18.1.1/src/roff/nroff/nroff.sh 2006-01-23 18:29:21.000000000 +0100 >@@ -87,11 +87,126 @@ > shift > done > >+# special hack to display Japanese and Czech man pages correctly in UTF-8 locale: >+ICONV="cat" >+case "`locale charmap 2>/dev/null`" in >+ UTF-8) >+ case "${LANGUAGE-${LC_ALL-${LC_MESSAGES-${LANG}}}}" in >+ ja*) >+ # Japanese man page in UTF-8 locale, special case! >+ # force the device 'nippon' to 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" >+ ;; >+ cs*|hu*|hr*|pl*) >+ # Czech, Hungarian, ... in UTF-8 seem to need special treatment as well: >+ T=-Tascii8 >+ export LC_ALL=cs_CZ.ISO-8859-2 >+ ICONV="iconv -f ISO-8859-2 -t UTF-8" >+ ;; >+ ru_RU*) >+ # Russian man page sources are in KOI8-R >+ T=-Tascii8 >+ export LC_ALL=ru_RU.KOI8-R >+ ICONV="iconv -f KOI8-R -t UTF-8" >+ ;; >+ # make 'man iso-8859-15' display correctly in UTF-8 locales using Euro >+ ca_ES*|de_AT*|de_BE*|de_DE*|de_LU*|en_BE*|en_IE*|es_ES*|eu_ES*|fi_FI*|fr_BE*|fr_FR*|fr_LU*|ga_IE*|gl_ES*|it_IT*|nl_BE*|nl_NL*|pt_PT*|sv_FI*|wa_BE*) >+ T=-Tascii8 >+ export LC_ALL=de_DE@euro >+ ICONV="iconv -f ISO-8859-15 -t UTF-8" >+ ;; >+ esac >+ ;; >+esac >+ >+guess_legacy_encoding () { >+ # Guess the legacy encoding used by the language/country >+ # found in the current LC_CTYPE value. >+ >+ # First determine the LC_CTYPE locale category setting >+ ctype=${LC_ALL-${LC_CTYPE-${LANG-en_US}}} >+ >+ case $ctype in >+ zh_TW*) >+ LEGACY_ENCODING=Big5 >+ ;; >+ zh_HK*) >+ LEGACY_ENCODING=Big5HKSCS >+ ;; >+ zh*) >+ LEGACY_ENCODING=GB2312 >+ ;; >+ ja*) >+ LEGACY_ENCODING=EUC-JP >+ ;; >+ ko*) >+ LEGACY_ENCODING=EUC-KR >+ ;; >+ ru*) >+ LEGACY_ENCODING=KOI8-R >+ ;; >+ uk*) >+ LEGACY_ENCODING=KOI8-U >+ ;; >+ pl*|hr*|hu*|cs*|sk*|sl*) >+ LEGACY_ENCODING=ISO-8859-2 >+ ;; >+ eo*|mt*) >+ LEGACY_ENCODING=ISO-8859-3 >+ ;; >+ el*) >+ LEGACY_ENCODING=ISO-8859-7 >+ ;; >+ he*) >+ LEGACY_ENCODING=ISO-8859-8 >+ ;; >+ tr*) >+ LEGACY_ENCODING=ISO-8859-9 >+ ;; >+ th*) >+ LEGACY_ENCODING=TIS-620 # or ISO-8859-11 >+ ;; >+ lt*) >+ LEGACY_ENCODING=ISO-8859-13 >+ ;; >+ cy*) >+ LEGACY_ENCODING=ISO-8859-14 >+ ;; >+ ro*) >+ LEGACY_ENCODING=ISO-8859-14 # or ISO-8859-16 >+ ;; >+ am*|vi*) >+ LEGACY_ENCODING=UTF-8 >+ ;; >+ *) >+ LEGACY_ENCODING=ISO-8859-1 >+ ;; >+ esac >+} >+ >+guess_legacy_encoding; >+TMPDIR=`mktemp -d /tmp/nroff.XXXXXX` >+if [ $? -ne 0 ]; then >+ echo "$0: Can't create temp directory, exiting..." >+ exit 1 >+fi >+ >+trap "exec rm -rf $TMPDIR" EXIT SIGHUP SIGINT SIGPIPE SIGTERM SIGIO >+cat > $TMPDIR/standard_input >+iconv -s -c -f utf-8 -t utf-8 < $TMPDIR/standard_input > /dev/null >+if [ $? -eq 0 ]; then >+ iconv -s -c -f utf8 -t $LEGACY_ENCODING < $TMPDIR/standard_input > $TMPDIR/standard_input.new >+ mv $TMPDIR/standard_input.new $TMPDIR/standard_input >+fi >+ > # This shell script is intended for use with man, so warnings are > # probably not wanted. Also load nroff-style character definitions. > > : ${GROFF_BIN_PATH=@BINDIR@} > export GROFF_BIN_PATH >-PATH=$GROFF_BIN_PATH:$PATH groff -mtty-char $T $opts ${1+"$@"} >+PATH=$GROFF_BIN_PATH:$PATH groff -mtty-char $T $opts ${1+"$@"} < $TMPDIR/standard_input | $ICONV > > # eof
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 144726
: 64580