I imported an xml file and save it to another xml file by LINQ in C#.
_xmlDocument = XDocument.Load("input.xml", LoadOptions.PreserveWhitespace);
I then opened the files and print out the content byte-by-byte.
using (FileStream fs = File.Open(pathAndFileName, FileMode.Open))
int size = (int)fs.Length;
byte data = new byte[size];
fs.Read(data, 0, size);
foreach (byte b in data)
But when I compared the printed output, the file "output.xml" contains some additional characters: 239, 187, 191,
where 239: Latin small letter i with diaeresis
187: Right double angle quotes
191: Inverted question mark
It also dropped 32 (ie Space) that was in "input.xml".
My question is: Is there any way to preserve the format of the input without adding funny characters or discarding space character?
They look identical in a text editor though.
Thanks in advance.