Sorry about the terse message last time.

Either the text reader or the stream reader takes an encoding, you have to
specify it the same as the encoding in the XML document.

If you pass XML to a SQL parameter you use Unicode (UTF-16) otherwise
always explicitly use the same encoding, there are lots of times where it
will bite you on the bum when you are not expecting it.

Davy

Sent via telegraph.

On 31 Jan 2014, at 01:31, Greg Keogh <[email protected]> wrote:

... When dealing with files .net understands BOM and removes it from
> returned data but it does not expect to see it in string/memory buffer.


You're right, and I think it makes sense now, the 3 lead bytes are just
being taken as text, so putting a TextReader in between lets then get
interpreted correctly for loading into the XDocument -- Greg

Reply via email to