From: Lee Culver Date: Wed, 19 Apr 2023 18:55:53 +0000 (-0700) Subject: Remove BOM marker from the middle of !traversexml (#3844) X-Git-Tag: accepted/tizen/unified/riscv/20231226.055542~39^2^2~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e185855b61597059094375ac13e8dbd12441b10d;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Remove BOM marker from the middle of !traversexml (#3844) --- diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/TraverseHeapCommand.cs b/src/Microsoft.Diagnostics.ExtensionCommands/TraverseHeapCommand.cs index 64647201a..40d282050 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/TraverseHeapCommand.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/TraverseHeapCommand.cs @@ -36,7 +36,7 @@ namespace Microsoft.Diagnostics.ExtensionCommands // create file early in case it throws using StreamWriter output = File.CreateText(Filename); - using (XmlWriter xml = Xml ? XmlWriter.Create(output, new XmlWriterSettings() { Indent = true, OmitXmlDeclaration = true }) : null) + using (XmlWriter xml = Xml ? XmlWriter.Create(output, new XmlWriterSettings() { Encoding = new UTF8Encoding(true), Indent = true, OmitXmlDeclaration = true }) : null) { using StreamWriter text = Xml ? null : output; @@ -81,6 +81,7 @@ namespace Microsoft.Diagnostics.ExtensionCommands using StreamWriter text = Xml ? null : new StreamWriter(rootObjectStream, Encoding.Default, 4096, leaveOpen: true); using XmlWriter xml = Xml ? XmlWriter.Create(rootObjectStream, new XmlWriterSettings() { + Encoding = new UTF8Encoding(false), CloseOutput = false, Indent = true, OmitXmlDeclaration = true,