﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Article By </title><link>https://www.c-sharpcorner.com/articles/</link><description>Articles from C# Corner</description><copyright>© 1999 - 2026  CSharp Inc. All contents are copyright of their authors.</copyright><atom:link href="https://www.c-sharpcorner.com/rss/authorarticles.aspx?MemberUniqueName=deepak-bhalla2" rel="self" type="application/rss+xml" /><item><title>How to save the XML file in "utf-8" format </title><description>I am trying to create an application in C# which will extract and save RSS feeds onto the D drive. I am using the following C# code to save the file on the disk
rssReader = new XmlTextReader(FeedAddress.Text);
rssDoc = new XmlDocument();
//Load the XML contents into a XMLDocument
rssDoc.Load(rssReader);
rssDoc.Save("D://text.xml");
Everything works wells and the file is saved in the "utf-8" format if the extension of the link is XML (e.g http://msdn.microsoft.com/rss.xml). The problem comes when I try to save a feed with .rss extension (e.g http://orangecounty.craigslist.org/apa/index.rss), instead of saving the feed in "utf-8" format it saves the feed in "ISO-8859-1" format.
Moreover, when I try to save the feed with .rss extension using the Save As option of the Internet Explorer it saves the feed in "utf-8" format but when I use the C# code to save the same feed it saves it in the "ISO-8859-1" format.
Is there any way to save the feed with .rss extension in "utf-8" format instead of "ISO-8859-1" format?
I have even tried to save the XML file using the class System.Net.WebClient but it is also saving the file in ISO-8859-1 format.
Thanks
Deepak</description><link>https://www.c-sharpcorner.com/blogs/how-to-save-the-xml-file-in-utf8-format</link><guid isPermaLink="true">https://www.c-sharpcorner.com/blogs/how-to-save-the-xml-file-in-utf8-format</guid><pubDate>Fri, 07 Aug 2009 00:00:00 GMT</pubDate><author>noreply@c-sharpcorner.com (Deepak Bhalla)</author></item></channel></rss>