I\'m a Java developer and I\'m using Ubuntu to develop. The project was created in Windows with Eclipse and it\'s using the Windows-1252 encoding.
To convert to UTF-8
sed cannot match \n because the trailing newline is removed before the line is put into the pattern space but can match \r, so you can convert \r\n (dos) to \n (unix) by removing \r
sed -i 's/\r//g' file
Warning: this will change the original file
However, you cannot change from unix EOL to dos or old mac (\r) by this. More readings here:
How can I replace a newline (\n) using sed?