NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Prevent PhpED from inserting carriage return (^M)


Joined: 27 Nov 2009
Posts: 54
Reply with quote
I am running PhpED 15 on Windows. My php scripts are on Linux and I am accessing it via Samba.

If I delete a line using PhpED, and then add the identical line back in, git shows it as being changed:

Code:
- <td></td>
- <td><img […]></td>
+ <td></td>^M
+ <td><img […]></td> ^M


Evidently, ^M is a carriage return. How can I change the settings to prevent this?
View user's profileFind all posts by NotionCommotionSend private message
Guru master

Joined: 24 Jul 2009
Posts: 717
Reply with quote
Whilst you have a file open in the editor, at the bottom of the PhpED window there is a bar which shows character set, file type (PHP) and encoding (WINDOWS / MAC OS / UNIX).

You can right-click those labels to change them.

The default encoding for all of my files is UNIX (which is generally correct) even when I open files using Samba to a Linux server. That is a single linefeed at end of lines. My guess is that you have WINDOWS encoding, which is adding the extra carriage return.

Check your IDE Settings for the Default file encoding (System default encoding) and Default file format (Autodetect). I use the default values for both of those and have never had an issue with encoding being changed on existing files and all my files, even new ones that I create on Windows, are UNIX encoded (which is good). You might find forcing that setting to UNIX fixes an issue.
View user's profileFind all posts by plugnplaySend private message


Joined: 27 Nov 2009
Posts: 54
Reply with quote
Thank you plugnplay!

Never noticed that tiny bar at the bottom.

Also changed Default file format to Unix.

Works great!
View user's profileFind all posts by NotionCommotionSend private message
Prevent PhpED from inserting carriage return (^M)
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic