I have an ANSI text file which I read and change and write back the changes. The file originally is stored as follows:
Fine. Using StreamReader ctor without encoding parameter (which is
not the same as Encoding.Default ) works fine (read+write) but the result is:
So my question is how to force WriteLine() to write new line as
0A and not
0D 0A . Btw, when viewing a text file with 0A new lines using Notepad it is not displayed correctly. Notepad++ displays it correctly. The file does
not have a BOM!
When using Encoding.UTF7 new lines are written as 0A but special characters like
é is written as +AOk- which is not was I want.
The trick Write(0x0A) also not works because it will be written as characters '1' and '0' ("10" dec == 0A hex).
How to do it correctly? Many thanks!
Programming is a kind of art but not all programmers are a
View Complete Post