Re: [BLACKBOX] Control codes CR and LF

From: [at]} <Rex>
Date: Mon, 21 Feb 2011 17:15:56 -0600

----boundary-LibPST-iamunique-1826087862_-_-
Content-type: text/plain

        As I recall, originally the DEC/DOS/Windows new line was CR+LF and UNIX was LF, but now it seems everyone interprets these two characters differently. Here's how I've got it figured.

For DEC and MS systems (and older systems) a CR meant "go back to the beginning of the line"; LF meant "turn the platen to the next line". Each has a different meaning; to continue a line of text in the usual way, you need both.

LF in Linux/UNIX seems to mean a new line. Same as DOS CR+LF. I don't know what CR does.

>From what was written, I guess to the Mac people, CR means the same thing as on a typewriter, namely the same as DOS CR+LF (but I thought Mac was UNIX!). I don't know what LF does.

        Both the Linux/UNIX and Mac interpretations make separate meanings obsolete. These interpretations are supposed to be characteristics of the OS, not individual applications. It used to be that if you wanted to read files from another OS, you might to translate them first. However, at some point there was a need to be able to read files from other platforms, and applications simply began to recognize imported newline combinations. The required logic doesn't seem difficult, except that I don't know how they handle multiple spacing, e.g., double or triple spacing. I suppose the simplest rule would be that either CR or LF or CR+LF combination is always treated as a newline. I suppose this is probably how they interpret it. I don't know what would be done with a LF+CR combination or some other mixed combination.

        There ought to be a standard on this, but if there is, someone apparently broke it about 30 years ago.

        Does that help?

Rex Couture


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1826087862_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHV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dGggYSBMRitDUiBjb21iaW5hdGlvbiBvciBzb21lIG90aGVyIG1peGVkIGNvbWJpbmF0aW9uLlxw
YXINClxwYXINClx0YWIgVGhlcmUgb3VnaHQgdG8gYmUgYSBzdGFuZGFyZCBvbiB0aGlzLCBidXQg
aWYgdGhlcmUgaXMsIHNvbWVvbmUgYXBwYXJlbnRseSBicm9rZSBpdCBhYm91dCAzMCB5ZWFycyBh
Z28uXHBhcg0KXHBhcg0KXHRhYiBEb2VzIHRoYXQgaGVscD9ccGFyDQpccGFyDQpSZXggQ291dHVy
ZVxwYXINClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3Nh
Z2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04u
Q0h9fQAAAAAA
----boundary-LibPST-iamunique-1826087862_-_---
Received on Tue Feb 22 2011 - 00:15:56 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:18 UTC