如何设置为utf-8 .............

问题描述:

如何将输出设置为utf-8



how do i set the ouput to utf-8

var sw = new StringWriter();

               document.Open();
               var hTextWriter = new HtmlTextWriter(sw);





               LabelFirstName.RenderControl(hTextWriter);
               LabelLastName.RenderControl(hTextWriter);
               RepeaterStrongestSkillsMax2.RenderControl(hTextWriter);
               LabelAbout.RenderControl(hTextWriter);

               String strHtml1 = sw.ToString();


               var styles = new iTextSharp.text.html.simpleparser.StyleSheet();
               var hw = new iTextSharp.text.html.simpleparser.HTMLWorker(document);
               hw.Parse(new StringReader(strHtml1));

               document.Close();

请参阅:

http://stackoverflow.com/questions/1564718/using-stringwriter-for-xml-serialization [ ^ ]

http://devproj20.blogspot.com/2008/02/writing-xml- with-utf-8-encoding-using.html [ ^ ]

http://rlacovara.blogspot.com/2011/02/how-to-create-xml-in-c-with-utf-8.html [ ^ ]

http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/90af541c-1acf-49df-9ace-55bf241170ed/ [ ^ ]

http://msdn.microsoft.com/en-us/library/system.text.encoding.utf8%28v=vs.80%29.aspx [ ^ ]

http://msdn.microsoft.com/en-us/ library / system.text.utf8encoding.aspx [ ^ ]
See these:
http://stackoverflow.com/questions/1564718/using-stringwriter-for-xml-serialization[^]
http://devproj20.blogspot.com/2008/02/writing-xml-with-utf-8-encoding-using.html[^]
http://rlacovara.blogspot.com/2011/02/how-to-create-xml-in-c-with-utf-8.html[^]
http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/90af541c-1acf-49df-9ace-55bf241170ed/[^]
http://msdn.microsoft.com/en-us/library/system.text.encoding.utf8%28v=vs.80%29.aspx[^]
http://msdn.microsoft.com/en-us/library/system.text.utf8encoding.aspx[^]