0
Welcome Guest! Login
0 items Join Now

New Mac adding Line Breaks?

    • J Cowles's Avatar
    • J Cowles
    • Jr. Rocketeer
    • Posts: 40
    • Thanks: 0

    New Mac adding Line Breaks?

    Posted 17 years 4 months ago
    • I just bought a new mac coming from the Windows world and I am having a strange problem that I just can't wrap my head around.

      When I open a template's PHP file (e.g. index.php) on some files, regardless of what text editor I use, an extra line break is being added after every line. So..
      Line1
      Line2
      Line3

      becomes...
      Line1
       
      Line2
       
      Line3

      At first I thought it might be my text editor, but no matter what program I open the files in it does this (Tried TextEdit, Dreamweaver, EMACs, VI). I thought it might be my FTP client because they files look fine when opening them up in Joomla's back end. So I tried several different FTP clients (Filezilla, FireFTP, Terminal FTP, Built-in-Dreamweaver---tried passive, changing charset, asci/binary). I find it odd that this only happens on some files and not others. And all files appear fine when editing online through Joomla backend for index.php and through JoomlaXplorer.

      I don't understand why this is happening and it only happens on my mac, not on my PC. Hopefully someone has an idea. Thanks!
  • Re: New Mac adding Line Breaks?

    Posted 17 years 4 months ago
    • I'm not a Mac user but my guess is that the files were created in a Windows environment and each line ends with both a Carriage Reaturn and a Line Feed.

      On your Mac (which I think is Unix like) files would be created with only a <LF> at the end so it interprets the <CR><LF> combination almost like 2 Line Feeds.

      I don't understand why the same effect is not seen on the server (unless the editors are set up to treat <CR><LF> as a single <LF>)


      Open the files in an editor where you can examine the content in hex and look at the last 2 characters.
    • J Cowles's Avatar
    • J Cowles
    • Jr. Rocketeer
    • Posts: 40
    • Thanks: 0

    Re: New Mac adding Line Breaks?

    Posted 17 years 4 months ago
    • Thanks, they are definately <LF><LF>s as the hex is 0A 0A. It must be that Joomla's template edit and JoomlaXplorer are somehow immune to the extra <LF> because I can't for the life of me figure out how between the server and the localhost something could be adding extras. Regardless, its is just a pain, but a fixable one. I just open the files in Text Wrangler and search replace \r\r with \r and all is well. Once the file is re-saved it retains the single <LF>. Just seems odd.

Time to create page: 0.071 seconds