{"id":249,"date":"2012-06-27T23:06:06","date_gmt":"2012-06-28T06:06:06","guid":{"rendered":"http:\/\/shanelabs.com\/blog\/?p=249"},"modified":"2012-06-27T23:06:06","modified_gmt":"2012-06-28T06:06:06","slug":"getting-rid-of-m-newline-characters-in-notepad","status":"publish","type":"post","link":"https:\/\/shanelabs.com\/blog\/2012\/06\/27\/getting-rid-of-m-newline-characters-in-notepad\/","title":{"rendered":"Getting rid of ^M newline characters in Notepad++"},"content":{"rendered":"<p>Today I was modifying someone else&#8217;s file when I noticed that when I uploaded it to the server it displayed horribly. All whitespace was gone, and in the place of newlines was ^M characters. Here&#8217;s a snapshot of how the file looked when I uploaded.<\/p>\n<p><a href=\"http:\/\/shanelabs.com\/blog\/wp-content\/uploads\/2012\/06\/M.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-250\" title=\"^M example\" src=\"http:\/\/shanelabs.com\/blog\/wp-content\/uploads\/2012\/06\/M.png\" alt=\"\" width=\"538\" height=\"126\" srcset=\"https:\/\/shanelabs.com\/blog\/wp-content\/uploads\/2012\/06\/M.png 538w, https:\/\/shanelabs.com\/blog\/wp-content\/uploads\/2012\/06\/M-300x70.png 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/a><\/p>\n<p>If I viewed it with &#8216;more filename.php&#8217; I didn&#8217;t see the ^M but it looked as if the whole file was on one line, and some characters had been replaced by {. Strange.<\/p>\n<p>It does not affect the server&#8217;s ability to run the file, but it does make maintenance a nightmare if you ever have to edit the file in the future.<\/p>\n<p>I had been using Notepad++ (notepad plus plus) to edit it, and I had never had this problem with any of my files. Turned out the file had originally been made on a Mac, which caused these weird characters to show up (sometimes it happens on Windows too).<\/p>\n<p>Luckily there&#8217;s an easy fix. With the file open in Notepad++, simply go to the Edit menu -&gt; EOL Conversion -&gt; Windows. It might also work if you choose Unix too. Then save the file, re-upload and you&#8217;re golden!<\/p>\n<p>Hope that helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I was modifying someone else&#8217;s file when I noticed that when I uploaded it to the server it displayed horribly. All whitespace was gone, and in the place of newlines was ^M characters. Here&#8217;s a snapshot of how the file looked when I uploaded. If I viewed it with &#8216;more filename.php&#8217; I didn&#8217;t see [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-249","post","type-post","status-publish","format-standard","hentry","category-software","category-web"],"_links":{"self":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/comments?post=249"}],"version-history":[{"count":3,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts\/249\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts\/249\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/media?parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/categories?post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/tags?post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}