Hi,
I have a doubt related to xml. I want to print the copyright “©” symbol … but I wan to do it programmatically and without using the symbol directly. Hence I am using the ASCII value (© ) for that instead of the actual character.
Sample code for it is as follows.
XmlTextWriter xtw = new XmlTextWriter("test.xml", Encoding.UTF8);
xtw.WriteStartElement("root");
xtw.WriteString("(©) " + DateTime.Now.Year.ToString() +All rights reserved.");
xtw.WriteFullEndElement();
xtw.Close();
however it gives the below output.
<root>&#169; 2007 All rights reserved.</root>
But I want the output to come as follows.
<root> © 2007 All rights reserved.</root>
Let me know where I am going wrong.
-Anil