Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.IO;
- namespace EncodingTest
- {
- class Program
- {
- static void Main(string[] args)
- {
- Encoding encoding = Encoding.GetEncoding(860);
- string content = "Não há de quê.";
- File.WriteAllText("output.txt", content, encoding);
- // read the content correctly
- string readContent = File.ReadAllText("output.txt", Encoding.UTF8);
- // faulty reading
- string faultyReadContent = File.ReadAllText("output.txt", encoding);
- Console.WriteLine(readContent);
- Console.WriteLine(faultyReadContent);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement