The character in question is U+0A0D, which is not in fact a valid character. You want U+000D followed by U+000A, and the fact that you are getting U+0A0D suggests that the text file uses a 16-bit little-endian Unicode encoding, so Encoding.Default
, Encoding.ASCII
and Encoding.UTF8
are all wrong. Encoding.Unicode
is more likely to be correct.
Note that there is no one fixed encoding for text files, so the fact that Encoding.Default
is wrong here doesn't make it wrong everywhere. Be prepared to deal with files with different encodings.