public string[] AbrirArquivo(byte[] Arquivo)
{
var arquivoTxt = new StreamReader(new MemoryStream(Arquivo), Encoding.GetEncoding("utf-8")).ReadToEnd();
var linhas = arquivoTxt.Split('\n');
return linhas;
}
I want to create a variable before the var arquivoTxt and store inside it, the value of Arquivo's Character encoding. So I will replace the "utf-8" to my new variable, and then through this manner, my work will be completed. The issue is, I don't know how to get the value of Arquivo's Character encoding. Could any body help me out to solve this, please?.
Because many of the users aren't English speakers, The problem often is because many of them upload ANSI encoded files, then the special Characters get broken, and it sucks. I really need to find out a way to figure this out.