From cea508c706409c3f83e716b355356724470d09f8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 24 Jun 2013 22:02:52 -0400 Subject: [PATCH] fixes #349 - Metadata for TV series in UTF-8 without BOM displays now as greeking --- .../Providers/BaseItemXmlParser.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 6c3d08a14f..04d92f3a60 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -67,8 +67,21 @@ namespace MediaBrowser.Controller.Providers item.People.Clear(); item.Tags.Clear(); - // Use european encoding as it will accept more characters - using (var streamReader = new StreamReader(metadataFile, Encoding.GetEncoding("ISO-8859-1"))) + //Fetch(item, metadataFile, settings, Encoding.GetEncoding("ISO-8859-1"), cancellationToken); + Fetch(item, metadataFile, settings, Encoding.UTF8, cancellationToken); + } + + /// + /// Fetches the specified item. + /// + /// The item. + /// The metadata file. + /// The settings. + /// The encoding. + /// The cancellation token. + private void Fetch(T item, string metadataFile, XmlReaderSettings settings, Encoding encoding, CancellationToken cancellationToken) + { + using (var streamReader = new StreamReader(metadataFile, encoding)) { // Use XmlReader for best performance using (var reader = XmlReader.Create(streamReader, settings))