Permalink
Browse files

SPRNET-1535 Ems and Nms XmlMessageConverters respect BOM setting

  • Loading branch information...
1 parent b96d53c commit 06ea2587b15ee50b69a92546e031b3c819addca1 @sbohlen sbohlen committed Jan 2, 2013
@@ -103,7 +103,7 @@ protected virtual string GetXmlString(object objectToConvert)
{
using (MemoryStream memoryStream = new MemoryStream())
{
- using (XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8))
+ using (XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, new UTF8Encoding(EncoderShouldEmitUtf8Identifier)))
{
XmlSerializer xs = new XmlSerializer(objectToConvert.GetType());
xs.Serialize(xmlTextWriter, objectToConvert);
@@ -102,7 +102,7 @@ protected virtual string GetXmlString(object objectToConvert)
{
using (MemoryStream memoryStream = new MemoryStream())
{
- using (XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8))
+ using (XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, new UTF8Encoding(EncoderShouldEmitUtf8Identifier)))
{
XmlSerializer xs = new XmlSerializer(objectToConvert.GetType());
xs.Serialize(xmlTextWriter, objectToConvert);

0 comments on commit 06ea258

Please sign in to comment.