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
Loading
VulpesPosted Sep 14, 2012, 1:44 PM
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 RepaskyPosted Sep 14, 2012, 2:43 PM
Encoding.Default
arep