0
When reading a TXT file, of accounting releases exporting by a third party system, being my problem in the lines that have the Nº.
VLR REF SOMETHING NO 1834 MORE TEXT
Using the class StreamReader
as follows
using (var reader = new StreamReader(@"D:\Projetos\Syns\Documentação\Contabilidade\exemplo.txt"))
{
string actual = reader.ReadToEnd();
Assert.AreEqual("VLR REF ALGUMA COISA Nº 1834 MAIS TEXTO", actual);
}
What I have as a return in current string is
VLR REF SOMETHING N?? 1834 MORE TEXT
and need to return the value equal to the text file.
What kind of enconding I have to use in this situation?
try
new StreamReader(@"D:\Projetos\Syns\Documentação\Contabilidade\exemplo.txt", Encoding.Default)
– Rovann Linhalis
Using that way solved me.
– Pablo Tondolo de Vargas