Re: The Art of Pickling: Binary vs Ascii difficulties

From: Andrew Dalke (adalke_at_mindspring.com)
Date: 10/15/04


Date: Thu, 14 Oct 2004 22:13:27 GMT

Scott David Daniels
> This C convention is a violation of the ASCII code as it was then
> defined, in order to save a byte per line (treating '\n' as end-of-line,
> not line-feed). An ASCII-conforming printer when fed 'a\nb\nc\r\n.\r\n'
> should print:
> a
> b
> c
> ..

Standards wonk that I am, I was curious about this. I've
never read the ASCII spec before. In my somewhat cursory
search I couldn't find something authoritative on-line that
claimed to be "the" ASCII spec. I did find RFC 20 "ASCII
format for network interchange" dated October 16, 1969,
so before the C convention was defined. Here's one copy
   http://www.faqs.org/rfcs/rfc20.html

It says

       LF (Line Feed): A format effector which controls the movement of
    the printing position to the next printing line. (Applicable also to
    display devices.) Where appropriate, this character may have the
    meaning "New Line" (NL), a format effector which controls the
    movement of the printing point to the first printing position on the
    next printing line. Use of this convention requires agreement
    between sender and recipient of data.

So it seems that it's not a violation, just a convention.

It happens that MS Windows and Unix (and old Macs) have
different conventions.

                                Andrew
                                dalke@dalkescientific.com



Relevant Pages

  • Re: Formatting in assembly
    ... the index counter in a loop isn't in the English Dictionary ... this is very known HLL convention, ... ; Convert Ascii to Integer: ... ; Convert Ascii to EAX: ...
    (alt.lang.asm)
  • Re: ASCII convention
    ... in article, a well known arabist recommends italics, and criticisez an author using /... ... / which is not possible in an ASCII post. ... convention in plain ASCII text if you thought that you italics is *always* used. ... If the question is really about _plain text_ and specifically _Usenet postings_, then there's a particular thing to note about using the solidus character as a delimiter on Usenet. ...
    (sci.lang)
  • Re: ASCII convention
    ... > what is the recommended convention for representing *letters* which may ... > convention in plain ASCII text if you thought that you italics is ... > not in plain text. ... for my own use in posts. ...
    (sci.lang)
  • Re: [SLE] wipe, clean, etc
    ... The convention is to set ... Isn't it ASCII 'U'? ... That's the character code that has strictly ... Randall Schulz ...
    (SuSE)
  • Re: Sperm Donor Moms Complain of Defective Kids
    ... This is a reasonable, compassionate rational for an infertile couple but in the case of a fertile single woman, this is, in fact, a violation of the UN Convention On The Rights Of The Child which states quite clearly that a child has a RIGHT to know it's biological parents...well if the father is an unidentified sperm donor, the child's basic human RIGHTS are being violated for the convenience of a selfish mother... ...
    (soc.men)