Editing a dev window from Windows adds odd characters

I mount the dev block using Dokan, so I can edit the files in the dev window from Windows. The problem is that the conversion from Windows to UNIX messed up the files. Despite the fact that the files contain the same code, they give different results if I typed the code in Windows compared to the dev block. This led to some unpleasant errors that I could not understand. How to ensure smoother switching between editing Windows code and UNIX?

+4
source share
2 answers

Your question may be incomplete, but I will try to answer anyway. If by unpleasant characters you mean ^ M at the end of the file, then the problem is with the CR LF characters that are at the end of Windows lines. Unix lines end only with LF, so you can see ^ M still on Unix.

This extra character can ruin some unix programs, and I see two workarounds for you:

a) Use a Windows editor that will not damage your file (notepad ++, editplus2, etc.)

b) use the "dos2unix" command on Unix to remove the extra character from your Unix file.

You can also see if this is really a problem by looking at the file with cat: cat -v "yourFile"

+1
source

How to ensure smoother switching between editing Windows code and UNIX?

You need to use a Windows editor that can read and write files with UNIX line ending markers.

Check the editor options to make sure that it can be configured for this, and if it cannot just find another editor.

When I need to do this on Windows, I use the Zeus editor.

+3
source

All Articles