I use PHP to change file encoding, but it generates a new empty line after each line.
$t_comment = file_get_contents('php://stdin');
$t_comment = iconv("ISO-8859-1", "UTF-8//IGNORE",$t_comment);
echo $t_comment;
Here is myfile.txt:
line1 [CR][LF]
line2 [CR][LF]
line3 [CR][LF]
Conversion command (BATCH):
C:\> type myfile.txt | php.exe myscript.php
or
C:\> php.exe myscript.php < myfile.txt
Result:
line1 [LF]
[LF]
line2 [LF]
[LF]
line3 [LF]
[LF]
Can you help me to fix this?