googleads / googleads-dotnet-lib

Google Ad Manager SOAP API .NET client library
Apache License 2.0
108 stars 198 forks source link

Correctly serializes xml on mono platform #3

Closed AnashOommen closed 10 years ago

AnashOommen commented 10 years ago

The code should look like this in src/Common/Util/SerializationUtilities.cs

public static string SerializeAsXmlText(object objToSerialize) {
   string retval = "";
   using (var writter = new Utf8StringWritter()) {
     new XmlSerializer(objToSerialize.GetType()).Serialize(writter, objToSerialize);
     retval = writter.ToString();
   }
   return retval;
  }
}

class Utf8StringWritter : StringWriter {
  public override Encoding Encoding {
    get { return new UTF8Encoding(false); }
  }
}
AnashOommen commented 10 years ago

Fixed in Common version 2.4/3.1.