C# Help reading foreign characters using StreamReader
Yes, it could be with the actual encoding of the file, probably unicode. Try UTF-8 as that is the most common form of unicode encoding. Otherwise if the file ASCII then standard ASCII encoding should work.
Not able to read special character £ using Streamreader in c#
Try to replace Encoding.Default
with Encoding.GetEncoding(437)
StreamReader from .csv - foreign chars and blank values showing up as '?'
"Fixed" it by going with tab delimited unicode .txt file instead of .csv. For some reason my version of excel doesn't have the option to save in unicode .csv...
Don't quite understand the problem of "rolling my own" parser, but maybe someday someone will take the time to explain it to me better. Still new-ish at this c# stuff...
how to read special character like é, â and others in C#
There is no such thing as "special character". What those likely are is extended ascii characters from the latin1 set (iso-8859-1).
You can read those by supplying encoding explicitly to the stream reader (otherwise it will assume UTF8)
using (StreamReader r = new StreamReader(fileName, Encoding.GetEncoding("iso-8859-1")))
r.ReadToEnd();
Related Topics
Wcf Httptransport: Streamed VS Buffered Transfermode
Get String Name of Property Using Reflection
How to Connect to Any of the Specified MySQL Hosts. C# MySQL
How to Create Trial Version of .Net Software
How to Set/Change/Remove Focus Style on a Button in C#
How to Retrieve the Screen Resolution from a C# Winform App
Entity Framework 4: How to Find the Primary Key
Impersonate User in Windows Service
Performance of Nested Yield in a Tree
How to Change Listview Selected Row Backcolor Even When Focus on Another Control
How to Get All Cookies of a Cookiecontainer
How to Use Datareceived Event of the Serialport Port Object in C#
Ef 6 - How to Correctly Perform Parallel Queries
Gracefully Handling Corrupted State Exceptions
Can You Compile C# So It Doesn't Need the .Net Framework at Runtime
How to Have a Loop in a Windows Service Without Using the Timer
How to Drag and Drop a Button from One Panel to Another Panel
Exceptions That Can't Be Caught by Try-Catch Block in Application Code