The first problem of interpretation of the Japanese encoding method might occur when downloading a web page. You can try running the text file through the nkf kanji filter to convert it into euc.
# nkf -e testfile.txt > testfile.euc
The problem with GhostScript is more complex. There are three strategies to solve this problem:
As of May, 1998, a popular method of printing Japanese
in Japan on a Linux system appears to be to use Aladdin Ghostscript
5.03 with VFLib. Binary packages for gs and the fonts are
available. The Debian-jp hamm-jp package name is
gs-aladdin-vflib_5.10-2.deb. If you install the binary
package, the only configuration you may need is the printcap
file. Even if you have an English PostScript printer, you
still need to run the Japanese text through Ghostscript. Right now
I have the following entries in my
/etc/printcap. If there
is a better way, send me e-mail. I assume there is a way to have
magicfilter detect a text file and run it through a filter for
lp|lj|hplj4l|HP Laserjet 4L:\ :lp=/dev/lp1:sd=/var/spool/lpd/hplj4l:\ :sh:pw#80:pl#72:px#1440:mx#0:\ :if=/etc/magicfilter/ljet4l-filter:\ :af=/var/log/lp-acct:lf=/var/log/lp-errs: lp-text|HP Laserjet 4ML text:\ :lp=/dev/lp1:\ sd=/var/spool/lpd/hplj4l:\ :sh:pw#80:pl#72:px#1440:mx#0:\ :if=/var/spool/lpd/lp-text/input-filter:
When printing a PostScript file, I give the command /verb+lpr -Plp filename+. This just runs the PostScript file through gs and sends it to the printer.
When printing a text file, I use the command /verb+lpr -Plp-text filename+. The input filter I use is shown below.
nkf -e | \ /usr/bin/psconv - | \ /usr/bin/gs -q -dSAFER -sDEVICE=ljet4 -r300 -dNOPAUSE -sOutputFile=- - |\ lpr -Plp
The nkf filter converts the text to EUC encoding then pipes it to psconv for conversion to Postscript. The gs program then uses the driver for my printer and pipes it to the printer.