fixed issues : Have exception if playing Chinese song #171 (#174)

This commit is contained in:
tyutony 2017-08-29 22:52:34 +08:00 committed by Jonas Dellinger
parent 8f76b4c36f
commit 04c1687cec

View File

@ -51,8 +51,6 @@ namespace SpotifyAPI.Local
return null;
}
response = response.Replace("\\n", "");
byte[] bytes = Encoding.Default.GetBytes(response);
response = Encoding.UTF8.GetString(bytes);
List<StatusResponse> raw = JsonConvert.DeserializeObject<List<StatusResponse>>(response);
return raw[0];
}
@ -110,9 +108,12 @@ namespace SpotifyAPI.Local
using (var wc = new ExtendedWebClient())
{
if (SpotifyLocalAPI.IsSpotifyRunning())
{
wc.Encoding = Encoding.UTF8;
response = "[ " + wc.DownloadString(address) + " ]";
}
}
}
catch
{
return string.Empty;