public void WillAssumeUtf8WhenNoEncodingAttributeAndNoBom() { string xml = "<?xml version='1.0'?><hello><world/></hello>"; using (XmlTextReader r = new XmlTextReader(StreamUtils.AsciiMemoryStream(xml))) { r.Read(); Assert.That(r.Encoding.CodePage, Is.EqualTo(Encoding.UTF8.CodePage)); } }