Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 47964 - lpr can nor print Japanese plain text file
lpr can nor print Japanese plain text file
Product: Red Hat Linux
Classification: Retired
Component: printconf (Show other bugs)
i386 Linux
high Severity high
: ---
: ---
Assigned To: Tim Waugh
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2001-07-09 04:18 EDT by Bill Huang
Modified: 2005-10-31 17:00 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-04-03 08:12:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Bill Huang 2001-07-09 04:18:07 EDT
Description of Problem:
lpr can't print Japanese plain text file.

How Reproducible:

Steps to Reproduce:
1. lpr aaa(Japanese plain text)

Actual Results:
Japanese can not be displayed on the paper

Expected Results:
Japanese can be printed properly

Additional Information:
Comment 1 Glen Foster 2001-07-13 15:47:13 EDT
This defect considered MUST-FIX for Fairfax gold-release.
Comment 2 Crutcher Dunnavant 2001-08-02 17:51:03 EDT

*** This bug has been marked as a duplicate of 50144 ***
Comment 3 Akira TAGOH 2001-08-24 01:43:08 EDT
This problem is different #50144
Comment 4 Bill Nottingham 2001-08-28 10:37:00 EDT
Please explain how it is different, and what's wrong.
Comment 5 Nakai 2001-08-28 15:30:23 EDT
foomatic problem is to support Japanese printers in printconf or not.
This problem is just a command line handling problem between gs and lpr.

There should be some code conversion process with 'nkf' while sending
data to lpr, but it affects other language. This problem also occurs
on our RHL7.1.
Comment 6 Crutcher Dunnavant 2001-08-28 18:35:46 EDT
this is _finaly_ fixed.
Comment 7 Akira TAGOH 2001-09-07 07:18:35 EDT
I have tested it on re0907.4 but this problem still be NOT fixed.
I tried test print on printconf-gui.

- Failed Japense JIS Text Testpage - the reason is mojibake.
- Failed Japanese EUC Text Testpage - same reason
- Failed echo "Japanese strings..." | lpr - the reason is empty page.

mf.cfg is here:
# foomatic/magicfilter configuration
# Make:         Canon
# Model:        LIPS-IVv
# Printer Id:   Canon-LIPS-IVv
# Driver:       lips4v

define(MAKE, `Canon')dnl
define(MODEL, `LIPS-IVv')dnl
define(COLOR, `false')dnl
define(PAGEsize, `Letter')dnl
define(TEXTfilter, pipe/postscript/ /usr/bin/mpage -b ifdef(`PAGEsize',
PAGEsize, Letter) -1 -o -P- -)dnl
define(PSfilter, `filter /usr/share/printconf/util/mf_postscript_wrapper 
--mfomatic -d lips4v-Canon-LIPS-IVv.foo')dnl
define(PCLfilter, `cat')dnl
define(PJLfilter, `cat')dnl
define(DEFAULTfilter, `cat')dnl
Comment 8 Akira TAGOH 2001-09-07 09:53:48 EDT
test page is prints out successfully by changing the filter locale to ja_JP.
However we can know the current locale. why does't the filter locale guess from
Also, test of "echo ... | lpr" can be correctly printed by the following:
echo "Japanese strings..." | nkf -mj | lpr
Comment 9 Tim Waugh 2002-02-04 10:38:14 EST
Oh, is this just that the locale _default_ is wrong?  If so, that's easy to fix
of course.  So that would fix the SJIS case properly, right?

To handle EUC-JP properly, we need a magicfilter that can recognise ISO-8859
text.  Investigating.
Comment 11 Tim Waugh 2002-02-04 13:31:46 EST
I have committed a change to CVS to set the default effective filter locale to
'jp_JP' if the LANG environment variable begins with 'ja'.
Comment 12 Akira TAGOH 2002-02-04 22:17:32 EST
That changing would be better.
However it's not fundamental solution. At least there are Japanese printers
which can't handle SJIS and EUC-JP encodings.
So that I suggest that it converts all of Japanese plain text to JIS encoding.
Comment 13 Tim Waugh 2002-02-05 04:55:08 EST
Okay.. HOW?
Comment 14 Akira TAGOH 2002-02-05 05:27:16 EST
Well, using define(DEFAULTfilter, pipe nkf -mj)dnl instead of is easiest, I
think. it works for me.
Comment 15 Tim Waugh 2002-02-05 05:35:25 EST
This is the current code for setting DEFAULTfilter:

if ($control->{'flags'}{'assume_data_is_text'}) {
        $default_filter = $text_filter;
} else {
        $default_filter = qw?`cat'?;

Am I correct in thinking that the $text_filter bit works for Japanese?  I.e. if
you set assume_data_is_text to false, does printing work then?
Comment 16 Akira TAGOH 2002-02-05 05:59:59 EST
Hmm, indeed. it works fine. it mean when sets 'ja_JP' to 'Effective Filter
Locale', this problem can be solved that 'Assume Unknown Data is Text' is forced
turn on, right?
Comment 17 Tim Waugh 2002-02-05 06:04:33 EST
Yes, in fact just like with ko and zh:

        # Enable 'Rerender Postscript' and 'Assume Data is Text'
        # if LANG begins with 'zh' or 'ko'
        rerender = 0
        locale = 'C'
        if os.environ.has_key("LANG"):
                lang = os.environ["LANG"]
                if lang[0:2] == "zh" or lang[0:2] == "ko":
                        rerender = 1

                if lang[0:2] == "ja":
                        locale = 'ja_JP'

I'll change this so that rerender is set to 1 (which also sets 'assume data is
text' to default to true) in the case that lang[0:2]=='ko'.
Comment 18 Tim Waugh 2002-02-05 06:20:12 EST
Hopefully this is fixed now in printconf-0.3.66-1 (currently building).  Note
that it only changes the defaults for a new queue; it doesn't change existing
queues.  Please test it out.

Thanks for your help.
Comment 19 Tim Waugh 2002-02-05 08:56:56 EST
Oh, wait, I copied the fix for something else, but it seems that that fix didn't
work to start with.  Re-fixing.
Comment 20 Tim Waugh 2002-02-05 10:54:55 EST
Okay, try 0.3.67-1.
Comment 21 Akira TAGOH 2002-02-06 08:00:44 EST
it works fine. Thanks!!
Comment 22 Tim Waugh 2002-04-03 08:12:08 EST
This seems to have broken again since 0.3.67 (see bug #62609).
Comment 23 Tim Waugh 2002-04-03 08:29:09 EST
Oh, it's alright.  This bug was for 'assume unknown data is text', which still

Note You need to log in before you can comment on or make changes to this bug.