J
Jon Skeet [C# MVP]
Duckwon said:I sent you zipped copies of the before and after file. I zipped the files
without ever opening them? so they are untouched.
And this time, lo and behold, when you look at them in a hex editor or
use a binary diff tool, we see that there is no difference between the
files until the place where the C# code started appending.
After that I opened the 'after' text file in a couple of other
editors (TextPad and Word). In those cases the text kept its format.
There is a font difference between the C++ text and the C# text. I
would prefer the text to be seamless.
The font and line ending differences are solely due to whatever the
editor chooses to do, based on a file that changes encoding half way
through.
When I open the same file in Notepad I still get the unformatted C++ text
(the first portion).
Sure - that's how it chooses to handle this problem.
This was with my original code, without your "Encoding.Unicode" fix.
Right - so the fix is the right one, it uses the same encoding for the
whole file. Now that we know it was notepad which was actually changing
the earlier contents of the file, there are no mysteries.