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"
source share