Skip to content

Commit

Permalink
Also don't write a byte order mark when converting a XDocument or IXP…
Browse files Browse the repository at this point in the history
…athNavigable to a XmpProfile (#1652)
  • Loading branch information
dlemstra committed Jun 8, 2024
1 parent 6542195 commit a067765
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Magick.NET.Core/Profiles/Xmp/XmpProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;
Expand Down Expand Up @@ -133,6 +134,7 @@ private static XmlWriter CreateXmlWriter(MemoryStream memStream)
var settings = new XmlWriterSettings
{
OmitXmlDeclaration = true,
Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false),
};
return XmlWriter.Create(memStream, settings);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void ShouldCreateProfileFromIXPathNavigable()

var xml = Encoding.UTF8.GetString(profile.ToByteArray());

Assert.Equal(@"<test />", xml);
Assert.Equal("<test />", xml);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void ShouldCreateProfileFromIXDocument()

var xml = Encoding.UTF8.GetString(profile.ToByteArray());

Assert.Equal("<test />", xml);
Assert.Equal("<test />", xml);
}
}
}

0 comments on commit a067765

Please sign in to comment.