Re: DOS Newline Character

From: Roger Leigh (${roger}_at_invalid.whinlatter.uklinux.net.invalid)
Date: 11/23/04


Date: Tue, 23 Nov 2004 22:02:27 +0000


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lew Pitcher <Lew.Pitcher@td.com> writes:

> Roger Leigh wrote:
> [snip]
>> Summary: CR/LF or CR or LF (or whatever your system uses) are merely
>> line-end markers. They don't directly correspond to any mechanical
>> operations, which are entirely hardware-dependent.
>
> Funny, the ECMA and ISO standards and my old ASR33 teletypewriter would
> disagree with you on this.

That's true, but not all devices support those standards (ECMA-48 ?)

> Your ESC/P printer seems to act otherwise, although I believe (because
> of my own use of an ESC/P printer) that you are incorrect in your
> assertions about the ESC/P interpretation of the characters. Certainly,
> on my Epson LQ-570 printer, with the "CR/LF" switch set to require both
> carriage returns and line feeds, a 0x0d causes printing to resume at the
> left margin of the current line, and 0x0a causes printing to resume at
> the current column of the next line.

You are correct. My assertion was from memory; double-checking with
the ESC/P2 reference:

CR: "Moves the print position to the left-margin position" (and
        flushes the line buffer)

LF: "Advances the vertical print position one line" and
        "Moves the print position to the left-margin position"
        (and flushes the line buffer on 9-pin ESC/P printers only)

ESC <: same as for CR, but additionally forces printing from the
        left-hand margin (i.e. unidirectionally; the default it
       b idirectional printing, so CR doesn't imply homing the head).

So it's not totally in agreement with ECMA-48: LF includes an implicit
CR, effectively making CR/LF redundant and transparently compatible
with UNIX line endings as a happy side-effect.

(I think the reference doesn't tell the full story WRT the DIP
settings: I've certainly had my 9-pin printers stair-step, which the
reference implies cannot happen, but this isn't the case with current
24-pin, inkjet and laser implementations of ESC/P2).

- --
Roger Leigh
                Printing on GNU/Linux? http://gimp-print.sourceforge.net/
                Debian GNU/Linux http://www.debian.org/
                GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFBo7NyVcFcaSW/uEgRAkQPAJ0YO/lML2WLYoA3n1G2xpQt6CBXqACeNMmE
27oah4NzMpe8vMpZPMbNPXY=
=1FDr
-----END PGP SIGNATURE-----



Relevant Pages

  • Re: DOS Newline Character
    ... the ECMA and ISO standards and my old ASR33 teletypewriter would ... > carriage returns and line feeds, a 0x0d causes printing to resume at the ... (I think the reference doesn't tell the full story WRT the DIP ... Printing on GNU/Linux? ...
    (alt.os.linux)
  • Re: CHECK FIELD FOR PRINTING
    ... Please make sure in your reference Library to install the Microsoft DAO Library Support in order for the Database options to work. ... DoCmd.OpenReport "Coupon", acViewNormal 'This is the report that has your coupon designed with the $50.00 on it. ... Conversation: CHECK FIELD FOR PRINTING ... I can give you VBA code examples where that can be done within VBA code without to much programming? ...
    (microsoft.public.access.macros)
  • Re: Documentation of build in functions
    ... | spective ISO Standards. ... |> You can purchase the ISO Standard for either language (for ... | Does a bookshop sell them? ... | would like to know if this C++ reference is inside. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Aligning lines and text
    ... Are you working inside a drawing canvas or other tool to create the 'diagrams' or just creating ... When you say the reference number moves when printing is this with any printer (including printing to PDF or MS Office Document ... MS Office System Products MVP ...
    (microsoft.public.word.drawing.graphics)
  • Re: Turning auto-negotation off drastically reduces network speed.
    ... matt wrote: ... informative and I am actually printing it right now for future ... reference. ... these opinions are mine, all mine; HP might not want them anyway... ...
    (comp.os.linux.networking)