I am pulling some data from a SQL Server database and writing it to a text file and, for the most part, the process is working as intended. There is one issue that I've been unable to resolve. Apostrophes are showing up as: ’
.
Here is the code writing to the file:
using (var writer = new StreamWriter(filePath, false))
{
foreach (var textLine in dataList)
{
writer.WriteLine(textLine);
}
}
I have tried using Encoding.Default
and Encoding.Utf8
on the text, but that didn't make a difference.
I'm opening up the files in Notepad, Notepad++, and UltraEdit.
Can anyone help me identify this problem?