Open your files in the
Notepad++ editor, and look at the menu option "
Encoding".
I think your C++ file is in ANSI and your C# file in Unicode which uses up to 2 bytes per char. See:
Unicode - Wikipedia[
^] and
C# in Depth: Unicode and .NET[
^]
In C# use
Encoding.ASCII
to write to a file in ascii format.
You can also convert to ASCII:
Encoding ascii = Encoding.ASCII;
Encoding unicode = Encoding.Unicode;
byte[] asciiBytes = Encoding.Convert(unicode, ascii, unicodeBytes);