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:
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.
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?
Created attachment 56644 [details] please try it with a2ps -X euc-jp test and a2ps -X latin1 test.
Created attachment 56645 [details] this result is generated by default or -X latin1. Japanese is broken.
Created attachment 56646 [details] this result is generated by -X euc-jp.
A quick test (with -X $(locale charmap)) indicates that nl_langinfo(CODESET) is the correct fix. Thanks.
Fixed in a2ps-4.13b-21.