I am mounting a dev box using Dokan so I can edit files on the dev box from Windows. The problem is that the conversion from Windows to UNIX messes up the files. Even though the files contain the same code, they produce different results if I typed the code in Windows compared to the dev box. This has led to some nasty errors that I could not figure out. How do I ensure that the transition between Windows to UNIX code editing goes more smoothly?
Your question may not be complete but I will try to answer anyway. If by nasty 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 ends only with LF, so you can see the ^M still in Unix.
This extra character may mess some unix programs, and I see two workarounds for you:
a) Use a Windows editor that will not corrupt your file (notepad++, editplus2, etc.)
b) use the "dos2unix" command in Unix in order to remove the extra character from your Unix file.
You can also see if this really you problem by viewing your file with cat: cat -v "yourFile"