{"id":454,"date":"2019-04-08T23:09:41","date_gmt":"2019-04-08T20:09:41","guid":{"rendered":"http:\/\/localhost\/bilisimkurdu\/?p=454"},"modified":"2019-04-08T23:09:41","modified_gmt":"2019-04-08T20:09:41","slug":"c-sharp-rss-reader-utf-8-problemi","status":"publish","type":"post","link":"http:\/\/localhost\/bilisimkurdu\/c-sharp-rss-reader-utf-8-problemi\/","title":{"rendered":"C# RSS Reader UTF-8 problemi"},"content":{"rendered":"\n
Merhaba Muhterem Ziyaret\u00e7iler,<\/p>\n\n\n\n
Bu yaz\u0131mda RSS Data \u00e7ekerken baz\u0131 harflerin (\u015f,\u00fc,\u00f6,\u0130,\u011f,\u0131,\u00e7) tam olarak g\u00f6r\u00fcnmemesi hakk\u0131nda olacak.<\/p>\n\n\n\n\n\n\n\n
E\u011fer RSS dosyas\u0131n\u0131 a\u015fa\u011f\u0131daki gibi veya benzer bir kodlarla al\u0131yorsan\u0131z;<\/p>\n\n\n\n
\nWebClient wclient = new WebClient(); \n string RSSData=wclient.DownloadString(RSSURL); \n XDocument xml = XDocument.Parse(RSSData); \n var RSSFeedData = (from x in xml.Descendants(\"item\") \n select new RSSFeed \n { \n Title = ((string)x.Element(\"title\")), \n Link = ((string)x.Element(\"link\")), \n Description = ((string)x.Element(\"description\")), \n PubDate = ((string)x.Element(\"pubDate\")) \n }); \n <\/code><\/pre>\n\n\n\nA\u015fa\u011f\u0131daki gibi d\u00fczenlemeniz gerekmektedir.<\/p>\n\n\n\n
WebClient wclient = new WebClient();\n string RSSData = \"\";\n\n using (WebClient webClient = new WebClient())\n {\n webClient.Encoding = Encoding.UTF8;\n RSSData = webClient.DownloadString(RSSURL);\n }\n\n XDocument xml = XDocument.Parse(RSSData);\n xml.Declaration.Encoding = \"utf-8\";\n var RSSFeedData = (from x in xml.Descendants(\"item\")\n select new RSSHaber\n {\n Title = ((string)x.Element(\"title\")),\n Link = ((string)x.Element(\"link\")),\n Description = ((string)x.Element(\"description\")),\n PubDate = ((string)x.Element(\"pubDate\")),\n\n\n }\n\n );<\/code><\/pre>\n\n\n\nA\u00e7\u0131klarsak,WebClient t\u00fcr\u00fcnde webClient nesnesini olu\u015fturarak using deyimi i\u00e7inde utf-8 uyumlu olacak \u015fekilde parse ettik.<\/p>\n\n\n\n
E\u011fer bu yaz\u0131yla ili\u015fkin anlatamad\u0131\u011f\u0131m\\anla\u015f\u0131lamayan konular varsa yaz\u0131n\u0131n alt\u0131na yorum yapabilirsiniz.<\/p>\n\n\n\n
\u0130yi ak\u015famlar.<\/p>\n","protected":false},"excerpt":{"rendered":"
Merhaba Muhterem Ziyaret\u00e7iler, Bu yaz\u0131mda RSS Data \u00e7ekerken baz\u0131 harflerin (\u015f,\u00fc,\u00f6,\u0130,\u011f,\u0131,\u00e7) tam olarak g\u00f6r\u00fcnmemesi hakk\u0131nda olacak.<\/p>\n","protected":false},"author":3,"featured_media":234,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[90,84],"tags":[266,276,277,278,279,299,300,631,632,713],"_links":{"self":[{"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/posts\/454"}],"collection":[{"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/comments?post=454"}],"version-history":[{"count":0,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/posts\/454\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/media\/234"}],"wp:attachment":[{"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/media?parent=454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/categories?post=454"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/tags?post=454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}