OBS User unknown 2007-07-26 23:58:55 +00:00 committed by Git OBS Bridge
parent 45162b17e0
commit faaf47badf
3 changed files with 56 additions and 21 deletions

View File

@ -1,24 +1,28 @@
--- src/encodings.c --- src/encodings.c 2005-01-05 16:11:54.000000000 +0100
+++ src/encodings.c 2007-07-19 14:21:02.681951968 +0200 +++ src/encodings.c 2007-07-26 14:25:02.000000000 +0200
@@ -106,6 +106,8 @@ static struct directory_entry directory_ @@ -106,6 +106,11 @@
{ "cs", "ISO-8859-2", "ISO-8859-2" }, /* Czech */ { "cs", "ISO-8859-2", "ISO-8859-2" }, /* Czech */
{ "hr", "ISO-8859-2", "ISO-8859-2" }, /* Croatian */ { "hr", "ISO-8859-2", "ISO-8859-2" }, /* Croatian */
{ "hu", "ISO-8859-2", "ISO-8859-2" }, /* Hungarian */ { "hu", "ISO-8859-2", "ISO-8859-2" }, /* Hungarian */
+ { "zh", "GB18030", "GB18030" }, /* Simiplfy Chinese */ + { "zh_TW", "BIG5", "BIG5" }, /* Traditional Chinese */
+ { "tw", "BIG5", "BIG5" }, /* Tradition Chinese */ + { "zh_HK", "BIG5HKSCS", "BIG5HKSCS" }, /* Traditional Chinese */
+ { "zh_CN", "GB18030", "GB18030" }, /* Simplified Chinese */
+ { "zh_SG", "GB18030", "GB18030" }, /* Simplified Chinese */
+ { "zh", "GB18030", "GB18030" }, /* Simplified Chinese */
{ "ja", "EUC-JP", "EUC-JP" }, /* Japanese */ { "ja", "EUC-JP", "EUC-JP" }, /* Japanese */
{ "ko", "EUC-KR", "EUC-KR" }, /* Korean */ { "ko", "EUC-KR", "EUC-KR" }, /* Korean */
{ "pl", "ISO-8859-2", "ISO-8859-2" }, /* Polish */ { "pl", "ISO-8859-2", "ISO-8859-2" }, /* Polish */
@@ -136,6 +138,8 @@ static struct charset_entry charset_tabl @@ -136,6 +141,9 @@
#ifdef MULTIBYTE_GROFF #ifdef MULTIBYTE_GROFF
{ "EUC-JP", "nippon" }, { "EUC-JP", "nippon" },
+ { "GB18030", "nippon" }, + { "GB18030", "nippon" },
+ { "BIG5", "nippon" }, + { "BIG5", "nippon" },
+ { "BIG5HKSCS", "nippon" },
#endif /* MULTIBYTE_GROFF */ #endif /* MULTIBYTE_GROFF */
{ NULL, NULL } { NULL, NULL }
@@ -170,7 +174,7 @@ static struct device_entry device_table[ @@ -170,7 +178,7 @@
#ifdef MULTIBYTE_GROFF #ifdef MULTIBYTE_GROFF
{ "ascii8", NULL, NULL }, { "ascii8", NULL, NULL },
@ -27,7 +31,7 @@
#endif /* MULTIBYTE_GROFF */ #endif /* MULTIBYTE_GROFF */
{ NULL, NULL, NULL } { NULL, NULL, NULL }
@@ -193,6 +197,7 @@ static struct less_charset_entry less_ch @@ -193,6 +201,7 @@
{ "UTF-8", "utf-8" }, { "UTF-8", "utf-8" },
#ifdef MULTIBYTE_GROFF #ifdef MULTIBYTE_GROFF
@ -35,7 +39,7 @@
{ "EUC-JP", "ja" }, { "EUC-JP", "ja" },
{ "KOI8-R", "koi8-r" }, { "KOI8-R", "koi8-r" },
#endif /* MULTIBYTE_GROFF */ #endif /* MULTIBYTE_GROFF */
@@ -283,6 +288,13 @@ char *get_page_encoding (const char *lan @@ -283,6 +292,13 @@
* roff encoding = UTF-8 * roff encoding = UTF-8
* output encoding = UTF-8 * output encoding = UTF-8
* EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8 * EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
@ -45,46 +49,57 @@
+ * source encoding = GB18030 + * source encoding = GB18030
+ * roff encoding = UTF-8 + * roff encoding = UTF-8
+ * output encoding = UTF-8 + * output encoding = UTF-8
+ * EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8 + * GB18030 -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
*/ */
const char *get_source_encoding (const char *lang) const char *get_source_encoding (const char *lang)
{ {
@@ -386,10 +398,13 @@ static int compatible_encodings (const c @@ -386,10 +402,14 @@
return 1; return 1;
#ifdef MULTIBYTE_GROFF #ifdef MULTIBYTE_GROFF
- /* Special case for ja_JP.UTF-8, which takes UTF-8 input recoded - /* Special case for ja_JP.UTF-8, which takes UTF-8 input recoded
- * from EUC-JP and produces UTF-8 output. This is rather filthy. - * from EUC-JP and produces UTF-8 output. This is rather filthy.
+ /* Special case for ja_JP.UTF-8 zh_CN.UTF-8 and zh_TW.UTF8, which + /* Special case for ja_JP.UTF-8, zh_CN.UTF-8, zh_TW.UTF-8, and zh_HK.UTF-8 which
+ * takes UTF-8 input recoded from EUC-JP and produces UTF-8 output. + * takes UTF-8 input recoded from EUC-JP, BIG5, BIG5HKSCS, GB18030, or GBK
+ * and produces UTF-8 output.
+ * This is rather filthy. + * This is rather filthy.
*/ */
- if (STREQ (input, "EUC-JP") && STREQ (output, "UTF-8")) - if (STREQ (input, "EUC-JP") && STREQ (output, "UTF-8"))
+ if ((STREQ (input, "EUC-JP") || STREQ (input, "BIG5") || + if ((STREQ (input, "EUC-JP") || STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") ||
+ STREQ (input, "GB18030") || STREQ (input, "GBK")) && + STREQ (input, "GB18030") || STREQ (input, "GBK")) &&
+ STREQ (output, "UTF-8")) + STREQ (output, "UTF-8"))
return 1; return 1;
#endif /* MULTIBYTE_GROFF */ #endif /* MULTIBYTE_GROFF */
@@ -449,13 +464,17 @@ const char *get_roff_encoding (const cha @@ -449,14 +469,26 @@
#ifdef MULTIBYTE_GROFF #ifdef MULTIBYTE_GROFF
/* An ugly special case is needed here. The utf8 device normally /* An ugly special case is needed here. The utf8 device normally
* takes ISO-8859-1 input. However, with the multibyte patch, when * takes ISO-8859-1 input. However, with the multibyte patch, when
- * recoding from EUC-JP it takes UTF-8 input instead. This is evil, - * recoding from EUC-JP it takes UTF-8 input instead. This is evil,
- * but there's not much that can be done about it apart from waiting - * but there's not much that can be done about it apart from waiting
- * for groff 2.0. - * for groff 2.0.
+ * recoding from EUC-JP, GB18030 or BIG5 it takes UTF-8 input + * recoding from EUC-JP, GB18030, BIG5, or BIG5HKSCS it takes UTF-8 input
+ * instead. This is evil, but there's not much that can be done + * instead. This is evil, but there's not much that can be done
+ * about it apart from waiting for groff 2.0. + * about it apart from waiting for groff 2.0.
+ * + *
*/ */
+ /*
+ * don't try to convert to UTF-8, the input might be UTF-8 already
+ * and groff 1.18.1.1 with the multibyte patch doesn't want
+ * UTF-8 input anyway, the /usr/bin/nroff script contains
+ * a hack to convert back to the appropriate legacy encoding
+ * if it gets UTF-8 input.
+ */
if (STREQ (device, "utf8")) { if (STREQ (device, "utf8")) {
const char *ctype = setlocale (LC_CTYPE, NULL); const char *ctype = setlocale (LC_CTYPE, NULL);
- if (STREQ (ctype, "ja_JP.UTF-8")) - if (STREQ (ctype, "ja_JP.UTF-8"))
- roff_encoding = "UTF-8";
+ if (STREQ (ctype, "ja_JP.UTF-8") || + if (STREQ (ctype, "ja_JP.UTF-8") ||
+ STREQ (ctype, "zh_CN.UTF-8") || + STREQ (ctype, "zh_CN.UTF-8") ||
+ STREQ (ctype, "zh_SG.UTF-8") || + STREQ (ctype, "zh_SG.UTF-8") ||
+ STREQ (ctype, "zh_TW.UTF-8")) + STREQ (ctype, "zh_TW.UTF-8") ||
roff_encoding = "UTF-8"; + STREQ (ctype, "zh_HK.UTF-8"))
+ roff_encoding = source_encoding; /* "UTF-8"; */
} }
#endif /* MULTIBYTE_GROFF */ #endif /* MULTIBYTE_GROFF */

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Thu Jul 26 14:33:08 CEST 2007 - mfabian@suse.de
- Bugzilla #292412 comment #47: accept both UTF-8 an legacy
encodings in the man-page sources for Japanese and Chinese
as well.
-------------------------------------------------------------------
Wed Jul 25 12:09:51 CEST 2007 - mfabian@suse.de
- Bugzilla #292412 comment #30 and #39: improve Chinese patch.
- use %find_lang macro
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jul 19 17:36:07 CEST 2007 - werner@suse.de Thu Jul 19 17:36:07 CEST 2007 - werner@suse.de

View File

@ -13,7 +13,7 @@
Name: man Name: man
BuildRequires: flex gdbm-devel groff less libbz2-devel libzio-devel zlib-devel BuildRequires: flex gdbm-devel groff less libbz2-devel libzio-devel zlib-devel
Version: 2.4.3 Version: 2.4.3
Release: 67 Release: 70
Summary: A Program for Displaying man Pages Summary: A Program for Displaying man Pages
License: GPL v2 or later License: GPL v2 or later
Group: System/Base Group: System/Base
@ -88,6 +88,7 @@ set +o posix
# \( -type d -printf '%%p/\n' \) -o \( -type l -printf '%%p\n' \) \) # \( -type d -printf '%%p/\n' \) -o \( -type l -printf '%%p\n' \) \)
#) > >(sort -u -t / | grep -vE '^(/tmp|/proc|/usr/src/packages)' > /tmp/man.list) #) > >(sort -u -t / | grep -vE '^(/tmp|/proc|/usr/src/packages)' > /tmp/man.list)
#rm /tmp/estamp /tmp/bstamp #rm /tmp/estamp /tmp/bstamp
%find_lang man-db
%pre %pre
test -d var/catman/ && rm -rf var/catman/ || true test -d var/catman/ && rm -rf var/catman/ || true
@ -95,7 +96,7 @@ test -d var/catman/ && rm -rf var/catman/ || true
%post %post
%{fillup_only -an cron} %{fillup_only -an cron}
%files %files -f man-db.lang
%defattr(-,root,root) %defattr(-,root,root)
%config /etc/manpath.config %config /etc/manpath.config
%attr(0744,root,root) /etc/cron.daily/suse-clean_catman %attr(0744,root,root) /etc/cron.daily/suse-clean_catman
@ -114,7 +115,6 @@ test -d var/catman/ && rm -rf var/catman/ || true
/usr/sbin/accessdb /usr/sbin/accessdb
/usr/share/groff/site-tmac/tmac.andb /usr/share/groff/site-tmac/tmac.andb
/usr/share/groff/site-tmac/tmac.andocdb /usr/share/groff/site-tmac/tmac.andocdb
/usr/share/locale/*/LC_MESSAGES/man?db.mo
%dir %{_mandir}/de %dir %{_mandir}/de
%dir %{_mandir}/de/man1 %dir %{_mandir}/de/man1
%doc %{_mandir}/de/man1/*.1.gz %doc %{_mandir}/de/man1/*.1.gz
@ -158,6 +158,13 @@ test -d var/catman/ && rm -rf var/catman/ || true
/var/adm/fillup-templates/sysconfig.cron-man /var/adm/fillup-templates/sysconfig.cron-man
%changelog %changelog
* Thu Jul 26 2007 - mfabian@suse.de
- Bugzilla #292412 comment #47: accept both UTF-8 an legacy
encodings in the man-page sources for Japanese and Chinese
as well.
* Wed Jul 25 2007 - mfabian@suse.de
- Bugzilla #292412 comment #30 and #39: improve Chinese patch.
- use %%find_lang macro
* Thu Jul 19 2007 - werner@suse.de * Thu Jul 19 2007 - werner@suse.de
- Add Chinese support to man (bug #292412) - Add Chinese support to man (bug #292412)
* Wed Jul 18 2007 - werner@suse.de * Wed Jul 18 2007 - werner@suse.de