Re: porting endlines
Re: porting endlines
- Subject: Re: porting endlines
- From: Jeffrey Oleander <email@hidden>
- Date: Wed, 28 Mar 2007 18:24:29 -0700 (PDT)
> Greg Guerin <email@hidden> wrote:
>> Denis Osadchy wrote:
>> Now to make our Xcode ported application similar to
>> Codewarrior built
>> application we can unset this setting in CW and change
>> all \r to \n and \n to \r. But our library is really
large
>> and I hope there is another more simple and fast
solution.
> If I understand this, you want your library to write CR
> (0x0D), not LF (0x0A).
Look at ye ancient archives. This has been discussed
before. IIRC, it's not quite as simple of a matter as it
seems at first blush because of people's differing personal
preferences and intentions.
It at least used to be that text editors like QUED/M had
options. You could tell it to expect CR or expect LF or
expect CRLF or LFCR as the line ending, and then you could
tell it to retain the original line endings when you saved,
or you could tell it to convert to whatever you wanted when
you saved.
Of course, that's not changing what you were telling your
own code to look for. If you want your own software to
handle line endings from different platforms or simple
files that use different conventions on the same platform,
then that's up to you. Sometimes you will run across files
that have both CRs and LFs and combinations of them, but
one is intended to be the line end while the others are
not, so there's no way of knowing without knowing the file
creators' intentions.
Of course, they derive from ye ancient teletype and
mechanical typewriters. There was a bar to the left of the
carriage. If you pressed the bar in such a way that it
pivoted on the axis where it was attached to the carriage,
it would feed 1/2 or 1 or up to 3 lies without returning
the carriage. But if you pressed it in such a way that it
did not pivot around that axis, but merely pushed the
carriage back to the right (for LTR language typewriters),
thus positioning the paper at the beginning of the line,
without feeding down to a new line. But if you gave it the
usual slap and shove it would both pivot, feeding up to 3
lines, and return the carriage at the same time.
Of course, CRTs and LCD and plasma monitors do not have
carriages, so computer people just kind of arbitrarily
decided how they wanted it to work. Some arbitrarily
decided that CR sufficed to end one line and begin another,
while others stuck to the old CRLF and still others chose
LF. A few systems actually did follow the mechanical
conventions. If you did a CR without LF, the following
material was printed over what was there already, while if
you did an LF it would move down (somewhat like a
down-arrow) and continue from the same/current horizontal
position on the page or screen.
So, we have Windoze which chose the CRLF convention, UNIX
with LF and old Mac with CR, and Apple has left it up to us
what to do with our files.
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden