man-db Japanese support quick hack
Package: man-db
Version: 2.3.10-69g
Severity: important (for Japanese user)
The current verison of man-db could not handle Japanese pages because
it always uses latin1 as nroff device. I think man-db would not works
for other languages which is not using latin1 character sets, such
as Korean/Chinese...
However, there are already jgroff/jless packages in debian. jgroff
is the package replacing groff package and it provides `nippon' device to
handle Japanese roff pages correctly.
So, if we apply the following patch to man-db-2.3.10-69g and
install jgorff instead of groff
install jless instead of less
(and set JLESSCHARSET environment variable as `japanese')
install manpages-ja
then we can see Japanese manual pages!
I think it's better that manpages-ja depends on (or recommends?)
jgroff and jless.
Note that the point of this patches are
- detect manpages is Japanese or not by manpath of the man pages
- if Japanese pages, add -Tnippon to nroff options
Of course, this is *very* quick hack, but it does not harm any users
and it works very well for Japanese users. I don't know whether it
works for Korean/Chinese and so on.
BTW, we should think how to internationalize man-db.
diff -Nru man-db-2.3.10/include/manconfig.h.in man-db-2.3.10.ja/include/manconfig.h.in
--- man-db-2.3.10/include/manconfig.h.in Sat May 22 04:21:17 1999
+++ man-db-2.3.10.ja/include/manconfig.h.in Sat May 22 04:02:56 1999
@@ -127,6 +127,8 @@
#ifndef NROFF_MISSING
# ifndef NROFF
# define NROFF "@nroff@"
+/* Japanese hack: 1999/05/22: ukai@debian.or.jp */
+# define NROFF_JA "@nroff@ -Tnippon "
# endif
#endif
diff -Nru man-db-2.3.10/src/man.c man-db-2.3.10.ja/src/man.c
--- man-db-2.3.10/src/man.c Sat May 22 04:21:18 1999
+++ man-db-2.3.10.ja/src/man.c Sat May 22 04:20:24 1999
@@ -376,6 +376,9 @@
static int ascii; /* insert tr in the output pipe */
static int save_cat; /* security breach? Can we save the cat? */
+/* Japanese hack: 1999/05/22 ukai@debian.or.jp */
+static int japanese; /* japanese page? */
+
static int found_a_stray; /* found a straycat */
#ifdef MAN_CATS
@@ -1352,7 +1355,12 @@
#ifdef NROFF_MISSING
assert (0);
#else
+/* Japanese hack: 1999/05/22: ukai@debian.or.jp */
+ if (japanese) {
+ filter = NROFF_JA;
+ } else
filter = NROFF;
+
#endif
}
@@ -2240,8 +2248,10 @@
free(catpath);
} else
database = mkdbname(manpath);
-
+/* Japanese hack: 1999/05/22: ukai@debian.or.jp */
+ japanese = (strstr(manpath, "/ja") != NULL);
in_cache = lookup(manpath); /* have we looked here already? */
+
if ( !in_cache ) {
if ( (dbf = MYDBM_RDOPEN(database)) && !dbver_rd(dbf)) {
Regards,
Fumitoshi UKAI
Reply to: