Menu

mac format, extra line breaks

2007-02-13
2012-11-13
  • Nobody/Anonymous

    My partner is saving files in mac format. He loves his text editor, which doesn't give him a choice, and that's fine. The problem arises, however, when I download a file he has created or modified off of the server and try to open it with Notepad++. I have a truly unneccessary amount of linebreaks in the file (one additional linebreak per line) and it makes code very difficult to read! It may not be the format of the file but something that notepad++ is doing. "Mac Format" is selected in the Format menu, however, which is what leads me to beleive this. Below is a sample of some code exhibiting the effects:

    <?php

    /**

    * Handler for page not found errors

    *

    * Generates a 301 Moved permanently error and redirects to index.php?main_page=page_not_found

    * Especially useful as for Google indexing

    *

    any help would be appreciated, this is driving me nuts!

     
    • Nobody/Anonymous

      For one thing, you only get 1:1 copyies with FTP using _Binary_, not ASCII, so switch that ;) (even worse if you transfer with UTF-## files).

      Notepad will only break on CR/LF, so Mac CR only or Unix LF only doesnt give any extra newlines. If the file erroneously has something like CRCRLF, Notepad shows one newline whilst notepad++ probably shows 2 (CR then CRLF).

      It helps to select View->End of Line from the menu, that way you can see what newline characters are present and how they act in Notepad++.
      You can select them too then and perform a find/replace on them, esp. with the Ctrl-R find/replace

       
    • Nobody/Anonymous

      It's not the problem of Notepad++.
      Check the settings of your ftp client.

      Don

       
      • Nobody/Anonymous

        I checked the file transfer settings; .php et al are all trasferred as ASCII. I tried turning compression off, but that doesn't change anything (using FileZilla).
        I just tried using the Windows CLI FTP program to download a file and open it in Notepad++, the results are the same. I don't think the FTP program is at fault, but any further info is appreciated!

         
        • Nobody/Anonymous

          Anyone have any insight on this? I am having the same problem. I opened the file in Windows Notepad and there are no extra line breaks, so it seems that Notepad++ is interpreting something as an extra break..

           
          • Nobody/Anonymous

            Same problem here.

            The text file is expanded from a ZIP file and downloaded via HTTP.  Yet there should be no relation of the problem to the transfer protocol.

            I can open the file without the extra line breaks with UltraEdit, which shows the file is in UNIX/UTF-8 format.  However, every files in the packages with extra line breaks are showing MAC/ANSI as UTF-8 in N++.  There is also no way to force file open with specified format and encoding.

            Would there be a fix to the problem?

             
Auth0 Logo