Weird behavior with TextEdit text files

Jump to First Reply
Posted:
in Genius Bar edited January 2014
I use both Mac OS X and Windows XP back and forth. I never really noticed this before with any text files created in Panther so it may be something with Tiger (I don't know).



When I create a text file using TextEdit on OS X and then open it using NotePad on Windows XP, all my breaks are screwed up. Everything is condensed into one block with square break characters to represent where I inserted a hard break.



Opening the files using Microsoft Word on Windows will display the file fine.



So it's kinda weird. Is TextEdit to blame or Notepad on Windows.

Comments

  • Reply 1 of 9
    keotkeot Posts: 116member
    I'm not sure of the solution, as I have only recently moved over to the Apple side. However, Windows uses different line terminators to *nix and hence you get those problems.



    I'm using fink on Tiger at the moment and found a nifty utility 'dosunix' which allows you to convert a DOS (Windows) plain text file to a *nix one. I think they'res a 'unixdos' program to do the job you're asking too.



    My solution is a bit of terminal kludge using what I know so far, so they'res bound to be a nice Applish solution to this.
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 9
    omegaomega Posts: 427member
    Try the save as function and change the encoding of the file.



    I used to have to do this with BBEdit files which were being swapped between macs and PC's, though it was a while ago and I have forgotten the encoding you need.



    EDIT: Just fired up BBEdit to have a look at the save options (also got asked if I wanted to upgrade 7.0.1 to 8.2.1 so you can see I have not used this app for awhile) and there was a function to save as DOS line breaks, and it might not have been the encoding at all.
     0Likes 0Dislikes 0Informatives
  • Reply 3 of 9
    ebbyebby Posts: 3,110member
    I'm just guessing here, but I think problem may be that TextEdit uses the Rich text format and notepad uses the simpler plain text format. Microsoft word has many more features and therefore can open rich text files. If you save the TextEdit file as plan text it should work.
     0Likes 0Dislikes 0Informatives
  • Reply 4 of 9
    mpmoriartympmoriarty Posts: 289member
    No I am working with plain text files. I do this when I am writing text files that I have to open in Notepad on Windows.



    Currently here are my Text Edit text encoding settings:



    Opening Files: Automatic

    Saving Files: Western (Windows Latin 1)



    I previously tried UTF-8, but that didn't really make a difference.



    I am aware that Windows and UNIX have different line breaks, but I figure that if the file is encoded in Western (Windows Latin 1) that it should open fine in notepad.



    Could someone please just create a plain text file in Text Edit and try opening in in Notepad on Windows to see if the same problem occurs.
     0Likes 0Dislikes 0Informatives
  • Reply 5 of 9
    xoolxool Posts: 2,460member
    Have you tried taking a file round trip? Make a new file in notepad, change it in Text Edit, and then open it again in notepad... are the linebreaks screwed up at any point along the way?
     0Likes 0Dislikes 0Informatives
  • Reply 6 of 9
    mpmoriartympmoriarty Posts: 289member
    Yes.



    I created a file with Notepad. Brought it to my Mac and edited it. The edited portions all were bunched together with two square characters representing where I had inserted a line break.
     0Likes 0Dislikes 0Informatives
  • Reply 7 of 9
    xoolxool Posts: 2,460member
    Here's a test I just ran:



    1) I created a text file with BBEdit that had DOS linebreaks.

    2) I opened the file in TextEdit and Saved As another .txt copy.

    3) I opened the new copy in BBEdit and the linebreaks were still DOS.



    I did notice that if I set TextEdit's text format preference to be plaintext, new text documents had unix linebreaks. However, based on the test above, files created with DOS linebreaks have that format preserved.



    Except for plaintext files created in TextEdit confusing NotePad, I'm not sure what your problem is.
     0Likes 0Dislikes 0Informatives
  • Reply 8 of 9
    mpmoriartympmoriarty Posts: 289member
    Maybe the UNIX line breaks created in TextEdit are confusing NotePad. I will test this out more comprehensively later. I will create another file using Notepad, edit it in TextEdit, save it, and then open it again in Notepad.



    Funny thing is that Word has no problem reading a text file created with TextEdit. I guess that's because Word accepts a lot more types of text.
     0Likes 0Dislikes 0Informatives
  • Reply 9 of 9
    xoolxool Posts: 2,460member
    It might be overkill, but I suggest you try TextWrangler. Its basically BBEdit lite and it should support all plaintext file types.
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.