using System;
using System.IO;
using System.Text;
class Program
{
static void Main(string[] args)
{
string inputFile = @"C:\file.txt"; // Path to your input file
string outputFile = @"C:\file2.txt"; // Path to your output file
ConvertEncoding(inputFile, outputFile);
Console.WriteLine("Conversion complete.");
}
static void ConvertEncoding(string inputFilePath, string outputFilePath)
{
using (StreamReader reader = new StreamReader(inputFilePath, Encoding.GetEncoding("iso-8859-1")))
{
using (StreamWriter writer = new StreamWriter(outputFilePath, false, Encoding.UTF8))
{
writer.Write(reader.ReadToEnd());
}
}
}
}