• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GCC3?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC3?


  • Subject: Re: GCC3?
  • From: Prachi Gauriar <email@hidden>
  • Date: Mon, 11 Aug 2003 20:21:38 -0500

On Monday, August 11, 2003, at 4:50 PM, Douglas Davidson wrote:

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.


One could also file a bug report at http://bugreporter.apple.com and get the bug fixed in TextEdit.

-Prachi
_______________________________________________
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: Phill Kelley <email@hidden>
References: 
 >Re: GCC3? (From: Douglas Davidson <email@hidden>)

  • Prev by Date: SIGBUS/SIGSEGV error problems
  • Next by Date: Re: SIGBUS/SIGSEGV error problems
  • Previous by thread: Re: GCC3?
  • Next by thread: Re: GCC3?
  • Index(es):
    • Date
    • Thread