Notepad changes the control characters when a StreamWriter accesses the file

Viewed 25

When I open Notepad regulary in my windows 10 machine the control characters are the following
enter image description here

but when I say:

Console.OutputEncoding = Encoding.UTF8;
Console.InputEncoding = Encoding.UTF8;
StreamWriter jj2 = new(new FileStream("C:/Users/User/Desktop/Testing/Dude2.txt",FileMode.Truncate), Encoding.UTF8, 4096);

the control characters change from CRLF to
enter image description here

I have tried many different configurations of the streamwriter and the underlying filestream but it is the same.
Can you please tell me why does this happen and how to change it?

0 Answers
Related