I wrote a PowerShell script to convert files from Windows to Unix with below code.
while ($line = $tempfile.ReadLine()) {
$outstream.Write($line + "`n")
}
It works fine if there are no special characters in data file. Now, if there are some special characters in data file they get converted as below:
test‡test
→ test¿½test
test,test
→ test¿½test
Any suggestion how it can be achieved without converting any characters?
NOTE: I don't want to use dos2unix
as this exe is not present on server. So I need solution either in batch script or PowerShell.