我有一個C#應用程序,其中存儲了用戶正確匹配正常特定字符串時要顯示的Unicode字符的代碼點值。在c中的Unicode渲染#
問題是,當我直接存儲代碼點值(比如\ uFB80)時,應用程序工作正常。但是當我從一個只有代碼點的文件或變量(在本例中爲FB80)讀取數據時,我得到了很多錯誤渲染的字符。將存儲的值更改爲\ uFB80或試圖在值的前面添加「\ u」都會導致系統將其讀爲\ uFB80,從而導致另一個錯誤結果。
這是怎麼回事?
XmlTextReader reader = new XmlTextReader("file.xml");
reader.Read();
reader.MoveToAttribute("glyph");
glyph = reader.Value;
// glyph will be "FB80"
// if xml file had "\uFB80", glyph will be "\\uFB80"
richTextBox1.SelectionFont = "QCF_P604";
richTextBox1.AppendText(glyph);
可以顯示你是如何讀取和存儲,顯示的價值? – 2010-01-22 05:17:50
請編輯您的問題並將您的代碼添加到它。評論中很難閱讀。 – 2010-01-23 17:09:29