Encoding Format Issue in .net core

  • Thread starter Thread starter Jadhav A
  • Start date Start date
J

Jadhav A

Guest
I want to Encode a file , i have already write some code for that but i think it's not working properly. Code like this actually I am doing to convert a csv file and i am select encoding format on database through drop down list after selecting a encoding format like ISO-8859-1 or Windows-1252 and download the data file .after downloaded data file open in notepad and see that file it will not to be selected encoding format



case "ISO-8859-1":
File.WriteAllBytes(fileName, ASCIIEncoding.Convert(
ASCIIEncoding.ASCII,
Encoding.GetEncoding("ISO-8859-1"),
convertToCSV(queryExecutionResult, fileName)));
break;
case "Windows-1252":
File.WriteAllBytes(fileName, ASCIIEncoding.Convert(
ASCIIEncoding.ASCII,
Encoding.GetEncoding(1252),
convertToCSV(queryExecutionResult, fileName)));
break;


Continue reading...
 
Back
Top