Skip to content

Commit

Permalink
Set WebClient encoding to UTF8
Browse files Browse the repository at this point in the history
  • Loading branch information
etishor committed Aug 16, 2011
1 parent eb3f1ba commit 5dcb2d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DiffbotApi/Diffbot.cs
Expand Up @@ -24,7 +24,8 @@ public Frontpage Frontpage(string url)
{
using (WebClient wc = new WebClient())
{
wc.Proxy = null;
wc.Proxy = null;
wc.Encoding = Encoding.UTF8;
string xmlString = wc.DownloadString(getQueryUrl(FRONTPAGE_API_SUFFIX, url));
XmlSerializer ser = new XmlSerializer(typeof(Frontpage));
return (Frontpage)ser.Deserialize(new StringReader(xmlString));
Expand All @@ -48,7 +49,8 @@ public Article Article(string url, bool comments = false, bool keepAds = false,
if (tags)
args.Add(new OptionalParameter() { Name = "tags", Value = "true" });

wc.Proxy = null;
wc.Proxy = null;
wc.Encoding = Encoding.UTF8;
string jsonString = wc.DownloadString(getQueryUrl(ARTICLE_API_SUFFIX, url, args.ToArray()));
return new Article(jsonString);
}
Expand Down

0 comments on commit 5dcb2d6

Please sign in to comment.