I am converting a program to C# from VB.NET. The last character of the field (from a DB) below does not come back correctly. It has a tilde or something over the "E".
I have "BAULÉ" that does not get converted correct in C# but did in VB.NET.
I am using StreamWriter and tried Encoding and nothing seem to work.
Do you have any idea what to do?
Thanks,
arep
Character does not convert in C#
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Sep 14, 2012, 9:44 AM EDT
The default encoding for StreamWriter is UTF8 which can handle any unicode character.
However, BAULÉ looks like it might be a French name so I'd try Windows 1252:
var sw = new StreamWriter(filePath, Encoding.GetEncoding(1252));
A RepaskyRank #8,108 · 228 reputationPosted Sep 14, 2012, 10:43 AM EDT
Encoding.Default
arep