Bug 64584 - can't print out for CJK
Summary: can't print out for CJK
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: a2ps
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-05-08 10:44 UTC by Akira TAGOH
Modified: 2008-05-01 15:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-05-08 11:22:09 UTC
Embargoed:


Attachments (Terms of Use)
please try it with a2ps -X euc-jp test and a2ps -X latin1 test. (7 bytes, text/plain)
2002-05-08 11:03 UTC, Akira TAGOH
no flags Details
this result is generated by default or -X latin1. Japanese is broken. (17.36 KB, application/postscript)
2002-05-08 11:05 UTC, Akira TAGOH
no flags Details
this result is generated by -X euc-jp. (18.42 KB, application/postscript)
2002-05-08 11:05 UTC, Akira TAGOH
no flags Details

Description Akira TAGOH 2002-05-08 10:44:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020408

Description of problem:
a2ps has a default encoding in /etc/a2ps-site.cfg. but this stuff is described
as latin1. so a2ps can't generate correct PS by default. this spec will confuses
the users. I think a2ps should refer to the current locale for default encoding.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.install a2ps (or don't touch /etc/a2ps-site.cfg)
2.a2ps something_like_japanese_text_file
3.
	

Actual Results:  printer print broken characters out. or when I specify a file
with -o option, gs and gv show the broken characters.

Expected Results:  should print out correctly.

Additional info:

Comment 1 Tim Waugh 2002-05-08 10:49:19 UTC
If you comment out the line 'Options: --encoding=latin1', does that help?  Or  
does a2ps need to be taught to figure out a sensible encoding based on locale?  
  
(If it needs to figure it out, any pointer on how to do this?) 
 
Please attach a file I can test with.  Thanks.

Comment 2 Akira TAGOH 2002-05-08 11:02:05 UTC
Well, I commented out Option line on /etc/a2ps-site.cfg. Unfortunately  a2ps has
crashed ;)

(gdb) r
Starting program: /usr/bin/a2ps '-o t.ps test'
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0805fc5f in strlower ()
(gdb) bt
#0  0x0805fc5f in strlower ()
#1  0x0805dc3e in get_encoding_by_alias ()
#2  0x0805eb67 in a2ps_job_finalize ()
#3  0x0804afc5 in main ()
#4  0x42017499 in __libc_start_main () from /lib/i686/libc.so.6

I'm not sure now I can't review a2ps's source code since HDD on our server is
crashed, doesn't nl_langinfo(CODESET) help you?

Comment 3 Akira TAGOH 2002-05-08 11:03:02 UTC
Created attachment 56644 [details]
please try it with a2ps -X euc-jp test and a2ps -X latin1 test.

Comment 4 Akira TAGOH 2002-05-08 11:05:02 UTC
Created attachment 56645 [details]
this result is generated by default or -X latin1. Japanese is broken.

Comment 5 Akira TAGOH 2002-05-08 11:05:57 UTC
Created attachment 56646 [details]
this result is generated by -X euc-jp.

Comment 6 Tim Waugh 2002-05-08 11:22:04 UTC
A quick test (with -X $(locale charmap)) indicates that nl_langinfo(CODESET) 
is the correct fix.  Thanks.

Comment 7 Tim Waugh 2002-05-30 16:37:33 UTC
Fixed in a2ps-4.13b-21.


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