我有一個包含類似的XML文件(從XFDL轉換):將unicode字符保存爲「“」成文件; C#
<custom:popUp xfdl:compute="toggle(activated,'off','on') == '1' ? viewer.messageBox('o Once you click ..... page.
o When you use the “Create ” function in.......Portal.','Information'):''">
我加載它,使用它保存...
XmlDocument xmlOut = new XmlDocument(); //note: not read only
FileStream outfs = new FileStream(tempOutXmlFileName, FileMode.Open, FileAccess.Read,
FileShare.ReadWrite);
xmlOut.Load(outfs);
xmlOut.Save(tempOutXmlFileName);
outfs.Close();
這個過程將一些Unicode的說明轉化爲實際的字符,這些字符完全混淆了xml/xfdl解析,因爲現在引號不應該包含引號。
有沒有人知道一種方式我可以保存文件與所有可愛的“
字符完好?
謝謝。
好,擺弄周圍了一下,得到XML-> XFDL轉換工作更好地後,我遇到了一個新問題。
下面的解決方案似乎工作,所有的XML解析是正確的,但讀取xfdl文件的程序似乎不喜歡,當我使用UTF-8編碼它,並希望編碼是ISO- 8859-1。
任何想法?
感謝您的幫助。請參閱我上面的編輯。 – emragins 2011-02-11 21:18:08