Files created in windows when moved to linux will have ^M character at the end of lines when you open the files in Vi editor.
To remove the strange characters open the file in Vi editor and type
:%s/.$//
This will search for the ^M pattern on the entire file and will remove all occurences.
Other option is to open the file with the strange characters and use the following search and replace pattern
:%s/^V^M//g
In the above command you need to press ctrl+v and ctrl+m in order for you to get the character ^M in the vi editor