Bug 47964
Summary: | lpr can nor print Japanese plain text file | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Bill Huang <bhuang> |
Component: | printconf | Assignee: | Tim Waugh <twaugh> |
Status: | CLOSED RAWHIDE | QA Contact: | Brock Organ <borgan> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 7.3 | CC: | tagoh, ynakai |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2002-04-03 13:12:13 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Bill Huang
2001-07-09 08:18:07 UTC
This defect considered MUST-FIX for Fairfax gold-release. *** This bug has been marked as a duplicate of 50144 *** This problem is different #50144 Please explain how it is different, and what's wrong. 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. this is _finaly_ fixed. I have tested it on re0907.4 but this problem still be NOT fixed. I tried test print on printconf-gui. but, - 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 # TERMINATION= # FILTER_LOCALE=C 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 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 locale? Also, test of "echo ... | lpr" can be correctly printed by the following: echo "Japanese strings..." | nkf -mj | lpr 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. 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'. 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. Okay.. HOW? Well, using define(DEFAULTfilter, pipe nkf -mj)dnl instead of is easiest, I think. it works for me. 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? 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? 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'. 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. Oh, wait, I copied the fix for something else, but it seems that that fix didn't work to start with. Re-fixing. Okay, try 0.3.67-1. it works fine. Thanks!! This seems to have broken again since 0.3.67 (see bug #62609). Oh, it's alright. This bug was for 'assume unknown data is text', which still works. |