Skip to content

Commit

Permalink
use utf-8 encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
zivillian committed May 30, 2023
1 parent 641f25d commit e7cb67b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ism7mqtt/ISM7/Protocol/XmlPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public abstract class XmlPayload : IPayload

public byte[] Serialize()
{
using var sw = new StringWriter();
using var sw = new Utf8StringWriter();
var xmlWriter = XmlWriter.Create(sw, new XmlWriterSettings {Indent = false});

var serializer = _serializers.GetOrAdd(GetType(), x => new XmlSerializer(x));
Expand All @@ -29,5 +29,10 @@ public byte[] Serialize()
}

public abstract PayloadType Type { get; }

class Utf8StringWriter : StringWriter
{
public override Encoding Encoding => Encoding.UTF8;
}
}
}

0 comments on commit e7cb67b

Please sign in to comment.