COmpensating for Mono bugs in XML encoding

This commit is contained in:
Rick Falkvinge
2013-07-07 04:05:14 +00:00
parent 891d5ea974
commit ed12e6504b
@@ -23,13 +23,16 @@ namespace Swarmops.Logic.Communications.Transmission
public static T FromXml (string xml)
{
// Compensate for Mono bugs
// Compensate for stupid Mono encoding bugs
if (xml.StartsWith("?"))
{
xml = xml.Substring(1);
}
xml = xml.Replace("�", "");
xml = xml.Replace("\x00", "");
var serializer = new XmlSerializer(typeof(T));
var stream = new MemoryStream();