I have a web application built with C# that creates a txt file based on user input information. This txt file is then converted to PGP in the application via a command line tool.
If a user enters international characters, they are changed when the PGP file is decrypted.
For example. If the user enters: "ó" it is converted to "ó" after I decrypt the PGP.
The txt file that is created has the correct characters in it, but when converted back to txt it does not. I imagine that this is an encoding issue, but I am not sure what to try.
This is what my code looks like:
//Create the text file
using (StreamWriter sw = File.CreateText(filePath + fileName)) //Create text file
{
sw.Write(bodyText); //Add body text to text file.
}
//PGP Encrypt
using (Process cmd = new Process()) //Open the pgp command line tool and start it using the arguments.
{
cmd.StartInfo.WorkingDirectory = "C:\\Program Files\\PGP Corporation\\PGP Command Line\\";
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.FileName = "pgp.exe";
cmd.StartInfo.Arguments = arguments;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.RedirectStandardError = true;
cmd.Start();
cmd.WaitForExit();
cmd.Close();
}