This brings a lot of problem later, specially with fastlane.
A Fix
This method is using Encoding.UTF8
public static void SaveAsXml(NSObject root, Stream outStream)
{
using var w = new StreamWriter(outStream, Encoding.UTF8, 1024, true);
w.Write(root.ToXmlPropertyList());
}
It should be using
public static void SaveAsXml(NSObject root, Stream outStream)
{
var utf8Encoding = new UTF8Encoding(false);
using var w = new StreamWriter(outStream, utf8Encoding, 1024, true);
w.Write(root.ToXmlPropertyList());
}
This is enough to save the xml in the correct form.
When using
PropertyListParser.SaveAsXml();
the output is an xml with the Byte Order Mark (BOM) which are non ASCII characters.I made a simple test of loading a binary Info.plist and the just save the same content but into an XML.
The result
Instead of
This brings a lot of problem later, specially with
fastlane
.A Fix
This method is using
Encoding.UTF8
It should be using
This is enough to save the xml in the correct form.