Ce n’est pas tant l’encodage que le caractère de fin de ligne qui pose soucis.Je n'avais pas vu la question sur l'éditeur ; j'utilise Notepad++ en encodage UTF8.
Dans notepad++ il faut choisir le LF comme caractère de fin de ligne.

Notepad++ EOL Conversion - Change line endings (crlf to lf) - Techtown
The EOL conversion in Notepad++ allows you to change the line termination character in a text file. Change file from Windows UNIX Mac format.
