Re: GCC3?
Re: GCC3?
- Subject: Re: GCC3?
- From: Douglas Davidson <email@hidden>
- Date: Mon, 11 Aug 2003 14:50:56 -0700
On Monday, August 11, 2003, at 02:20 PM, M. Uli Kusterer wrote:
At 14:49 Uhr -0400 11.08.2003, Sailor Quasar wrote:
Speaking of inconsistencies in line endings, the thread on this list
regarding that seems to have left out that point. If you open a file
with Windows line endings in TextEdit and add some new lines, don't
try to read that file in Windows without first going in with BBEdit
or CodeWarrior and manually repairing every line. As far as I can
tell, this is a problem endemic to the entire Cocoa text system.
Blaming Cocoa's text system for this is like blaming the police
president for your parking tickets.
The actual problem lies with the differing nature of line endings on
various platforms. Cocoa is actually doing you a service by correctly
displaying text no matter what line endings it uses, be it Unix-style
0x0A, Mac-style 0x0D, or Windows-style 0x0D0A.
The problem is that Cocoa will generate line endings in whatever
format the current OS uses natively, which is 0x0D on Mac. Since you
didn't convert the text beforehand, you end up with mixed line feeds.
Cocoa is guilty merely in that it lets you get away with displaying
foreign line endings, and maybe because it doesn't warn you.
Try opening Windows text files in another text editor, like good ol'
SimpleText, and you see an alternative approach to the problem: Not
handling it at all. SimpleText will simply display all the text on one
line. And I think MLTE uses the same approach.
An application could detect this situation and offer to convert line
terminations for you. The text system could perhaps help with this,
but since the appropriate behavior depends heavily on context, it would
not be appropriate for it to do so automatically. It it something that
should be fairly straightforward for an application to do, provided
that one can determine what the right behavior is.
One could also perhaps blame Windows for its lack of flexibility, but
blaming Windows is a bit like blaming City Hall--it might be
therapeutic, but it won't get you very far.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
- Follow-Ups:
- Re: GCC3?
- From: Prachi Gauriar <email@hidden>
References: | |
| >Re: GCC3? (From: "M. Uli Kusterer" <email@hidden>) |