fixes #349 - Metadata for TV series in UTF-8 without BOM displays now as greeking

pull/702/head
Luke Pulverenti 12 years ago
parent db607a618b
commit cea508c706

@ -67,8 +67,21 @@ namespace MediaBrowser.Controller.Providers
item.People.Clear(); item.People.Clear();
item.Tags.Clear(); item.Tags.Clear();
// Use european encoding as it will accept more characters //Fetch(item, metadataFile, settings, Encoding.GetEncoding("ISO-8859-1"), cancellationToken);
using (var streamReader = new StreamReader(metadataFile, Encoding.GetEncoding("ISO-8859-1"))) Fetch(item, metadataFile, settings, Encoding.UTF8, cancellationToken);
}
/// <summary>
/// Fetches the specified item.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="metadataFile">The metadata file.</param>
/// <param name="settings">The settings.</param>
/// <param name="encoding">The encoding.</param>
/// <param name="cancellationToken">The cancellation token.</param>
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 // Use XmlReader for best performance
using (var reader = XmlReader.Create(streamReader, settings)) using (var reader = XmlReader.Create(streamReader, settings))

Loading…
Cancel
Save