[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dot matrix printer unicode question



On Fri, Jul 31, 2009 at 04:22:51PM -0400, Jude DaShiell wrote:
> Could unicode be the reason my Panasonic KX-p1123 printer prints
> garbage on sveral pages when I try printing out a 13 line long text
> file on Linux and that same file gets printed perfectly when done
> with a real dos computer?

Possibly.  However, it's more likely something else is going on.

> I have a printer queue set up which
> allows lpr and lp both to print garbage last time a sighted person
> took a look dollar signs question marks and very long lines of text
> were being printed.  This is a grocery list with one item per line.

Could you attach the file so we can take a look?

"file filename" will tell you the type of file you are looking at.
If it's not plain ASCII, that might be a clue.

DOS used codepages, which were character sets extending ASCII with
additional characters (symbols, accented characters etc.).  On
dot matrix printers, one would configure the printer character
codepage to match the codepage you used in DOS.  On the printer
side, these were configured using DIP switches on the back of the
printer, or in the printer's firmware using buttons on the front
panel.  Note that some had a switch to turn $ into # or # into £
etc., which might be a problem.

When you print using e.g. "cat file > /dev/lp0", the file will be
copied byte-for-byte to the printer.  No translation will occur.
When you printed from DOS, it's possible that the application
used to print did some translation.  "TYPE file > LPT1" or
"COPY file LPT1" will do exactly what the Linux cat command does,
so you can compare the two directly.

On DOS, the line endings are CRLF, while on Linux, they are LF only.
Most printers have a switch to control the line ending style.


If your
       printed text
                   looks like
                             this.

this is because your printer is expecting DOS format text, and is not
adding the "missing" CRs.

For CUPS, set the queue to "raw" to avoid any extra converson steps.

If on Linux the file is encoded in UTF-8 (Unicode), the printer
won't understand the extended characters and you will see garbage.
If you attach the file, we can see exactly what's being sent, and
what might be going wrong.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: signature.asc
Description: Digital signature


Reply to: