fork download
  1. using System;
  2. using System.IO;
  3. using System.Xml;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription);
  10.  
  11. string data = "<?xml version=\"1.0\xbf\"?>";
  12.  
  13. byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(data);
  14. MemoryStream stream = new MemoryStream(byteArray);
  15.  
  16. try
  17. {
  18. using (var xml = XmlReader.Create(stream))
  19. {
  20. while (xml.Read()) { }
  21. }
  22. }
  23. catch (XmlException) { }
  24. }
  25. }
  26.  
Success #stdin #stdout 0.08s 34028KB
stdin
Standard input is empty
stdout
.NET 6.0.0-rtm.21522.10