You may also try the Default encoding, which uses the current system’s ANSI codepage.
StreamReader reader = new StreamReader(inputFilePath, Encoding.Default, true)
When you try using the Notepad “Save As” menu with the original file, look at the encoding combo box. It will tell you which encoding notepad guessed is used by the file.
Also, if it is an ANSI file, the detectEncodingFromByteOrderMarks parameter will probably not help much.
Related Contents:
- How can I convert a hex string to a byte array? [duplicate]
- How can I detect the encoding/codepage of a text file
- Convert a Unicode string to an escaped ASCII string
- Converting string to byte array in C#
- Determine a string’s encoding in C#
- How to achieve Base64 URL safe encoding in C#?
- Effective way to find any file’s Encoding
- C# Convert string from UTF-8 to ISO-8859-1 (Latin1) H
- How to detect the character encoding of a text file?
- How do I decode a base64 encoded string?
- How can I transform string to UTF-8 in C#?
- Strip the byte order mark from string in C#
- Does C# have an equivalent to JavaScript’s encodeURIComponent()?
- How do you remove invalid hexadecimal characters from an XML-based data source prior to constructing an XmlReader or XPathDocument that uses the data?
- How to get ASCII value of string in C#
- Signing and verifying signatures with RSA C#
- C#: Class for decoding Quoted-Printable encoding?
- Is there a standard way to encode a .NET string into JavaScript string for use in MS Ajax?
- Encoding trouble with HttpWebResponse
- What’s the difference between UTF8/UTF16 and Base64 in terms of encoding
- Encoding.GetEncoding can’t work in UWP app
- What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it?
- How do I encode and decode a base64 string?
- MVC Form not able to post List of objects
- How can I protect my .NET assemblies from decompilation?
- Accessing MVC’s model property from Javascript
- Can I find out the return value before returning while debugging in Visual Studio?
- Dynamically Created Controls losing data after postback
- Entity framework left join
- Sort ObservableCollection through C#
- C# ASP.NET Single Sign-On Implementation
- To return IQueryable or not return IQueryable [closed]
- How can I sort a string of text followed by a number using LINQ
- WPF MessageBox window style
- How to mock an async repository with Entity Framework Core
- Can bindings create memory leaks in WPF?
- Efficiently get full json string in JsonConverter.ReadJson()
- Fake-scrolling containers with very many controls
- Casting vs Converting an object toString, when object really is a string
- Declaration of Anonymous types List [duplicate]
- “The semaphore timeout period has expired” error for USB connection
- How do I log a user out when they close their browser or tab in ASP.NET MVC?
- Using Cookie in Asp.Net Mvc 4
- How to make correct date format when writing data to Excel
- The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue
- Save detached entity in Entity Framework 6
- What are some alternatives to RegistryKey.OpenBaseKey in .NET 3.5?
- NewtonSoft.Json Serialize and Deserialize class with property of type IEnumerable
- Custom Brace formatting with Resharper
- IEnumerable and order