fixed problem with LG GlobalClone XML file writer:

no more UTF BOM, use UTF8 for encoding, specify UTF8 in XML declaration
This commit is contained in:
hbeham
2014-05-30 00:24:29 +02:00
parent 7c1cdbdba3
commit bddbf67dd5
3 changed files with 22 additions and 4 deletions

View File

@@ -297,8 +297,22 @@ namespace ChanSort.Loader.GlobalClone
}
}
}
doc.Save(tvOutputFile);
// by default .NET reformats the whole XML. These settings produce the same format as the TV xml files use
var settings = new XmlWriterSettings();
settings.Encoding = new UTF8Encoding(false);
settings.Indent = true;
settings.NewLineChars = "\r\n";
settings.NewLineHandling = NewLineHandling.Replace;
settings.OmitXmlDeclaration = true;
settings.IndentChars = "";
using (StringWriter sw = new StringWriter())
using (XmlWriter xw = XmlWriter.Create(sw, settings))
{
doc.Save(xw);
var xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n\r\n" + sw;
File.WriteAllText(tvOutputFile, xml, settings.Encoding);
}
}
#endregion

View File

@@ -25,7 +25,7 @@ namespace ChanSort.Ui
{
public partial class MainForm : XtraForm
{
public const string AppVersion = "v2014-05-29";
public const string AppVersion = "v2014-05-30";
private const int MaxMruEntries = 10;

View File

@@ -1,6 +1,7 @@
Version v2014-05-29 =======================================================
Version v2014-05-30 =======================================================
Changes:
- fixed issues with LG "GlobalClone" XML file format
- supports LG LB55xx and LB56xx xxLB*.TLL channel lists
- supports LG LB58xx*.TLL channel lists
(satellite channels ONLY due to lack of DVB-C/T test files)
@@ -119,6 +120,9 @@ OTHER DEALINGS IN THE SOFTWARE.
Change log ================================================================
2014-05-30
- fixed issues with LG "GlobalClone" XML file format
2014-05-29
- supports LG LB55xx and LB56xx xxLB*.TLL channel lists
- supports LG LB58xx*.TLL channel lists