Hi I have some code to re-encode uniface text files in to ANSII for use by a 3rd party application.
This code works fine if I create a new text file using notepad, save it as Unicode and run my script. I get a lovely output file in ANSII.
When i use an actual output file from our general ledger, the script runs & writes out the file, but the output is still showing as unicode.. Could anyone shed any light on what might be going on here??
Here is my script:
foreach (FileInfo file in files)
{
filename = file.Name.ToString();
destinationpath = dest + "ARI" + i + ".dat";
i++;
StreamReader fileStream = new StreamReader(file.FullName);
string fileContent = fileStream.ReadToEnd();
fileStream.Close();
StreamWriter ansiWriter = new StreamWriter(destinationpath, false, Encoding.GetEncoding(1250));
ansiWriter.Write(fileContent);
ansiWriter.Close();
}
Many thanks!!