> "What is the ASCII code for newline?"
BTW, Is it "Henk" or "Hank"?
On Sat, 29 Dec 2007, der Mouse wrote:
0x0a, one of whose names is NL. This is well-defined.
and the whole world is a ?
This is not a question about ASCII; it is a question
about how some
unspecified system represents linebreaks - about how that system uses
ASCII, perhaps.
true, agreed
Worse, on many systems the answer differs depending
what point you
measure at. On most Unix variants, for example, it's 0x0a when
measured in files or in C strings, but 0x0d 0x0a when measured on
hardware serial lines.
in which case, what characters would
fprintf(PRN, "%s" , "X\n" );
actually send to the printer?
Is
'\n' 0Dh? 0Ah? 0Dh 0Ah? 0Ah 0Dh?
It's only one character; that much
is well-specified (well, assuming
your '\n' was supposed to be C).
Yes, indeed, although there are numerous
derivatives of C with same or
similar behavior.
in which case, HOW MANY characters would
fprintf(PRN, "%s" , "X\n" );
actually send to the printer?
What the numerical value of that
character is is not well-defined without reference to a particular
system (though 0x0a is by far the commonest, probably because it's
ASCII NL).
'\n' is VERY esplicitly defined as "NEWLINE"
My documentation of ASCII is rather dated (Bremer, Interface Rage, 1973,
etc.) They seem to consistently define 0Ah as LF (LINEFEED), and I don't
have any ASCII standards documents that call 0Ah "NEWLINE", although there
are plenty of unix C textbooks that make that statement informally.
It often bogs down beginning students for a few hours dealing with using
'\n' to start a newline for output, but looking for '\r' when searching
for the Carriage Return in input ( getch(), etc.)
Before you
answer, contemplate:
"Why have SO MANY companies got that wrong?"
("wrong" actually means any choice other than yours, and each company
thought that there were good reasons for doing it their way.)
Then in what sense
are those choices "wrong"?
so, may I assume that you have no objection to Tandy defining NEWLINE as
0Dh?
By definition, in the SMTP transaction, the line
breaks are 0x0d 0x0a
octet pairs (and 0x0d and 0x0a octets do not occur in any other context
than 0x0d-0x0a line-break pairs..unless, of course, the sending SMTP
code is broken).
Of course, there is a lot of broken SMTP code out there. Looking at
headers makes me think Hank's mail was actually sent through Hotmail,
which means it's almost certain the sending SMTP code was broken
(though not necessarily in this way).
VERY MUCH agreed
However, as it arrived at my system, it apepars to
have been fine in
this regard, so I see no reason to think line-break botches elsewhere
than between the list and Ethan are behind this. I'm mystified as to
what provoked the behaviour Ethan saw, since he says it's just Hank's
mail, and as far as I can tell Hank's mail is fine after passing
through the list.
OK
Right now, I'm using a recent version of PINE on a unix system that I am
TELNETing to with a WINDOZE 98 machine (when you are not at home, you
make do with what is available)
Henk's text looks good, but the content that he was QUOTING has mangled
newlines that look as though all of the control characters were stripped
out, and then soft newlines inserted [often in the wrong places] by the
display program.
Ethan, did Hank send you an off-list copy, and you
replied to that one,
maybe? It's the most plausible theory I see offhand.
Nope.
Although Henk and Ethan did manually reformat a few messages.
--
Grumpy Ol' Fred cisin at
xenosoft.com