首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

\u5df2 这个是什么字 怎么计算

2012-01-15 
\u5df2这个是什么字如何计算\u5df2这个是什么字如何计算stringunicode5df2 strings1unicode.Substrin

\u5df2 这个是什么字 如何计算
\u5df2     这个是什么字     如何计算

string   unicode   =   "5df2 ";
string   s1   =   unicode.Substring(0,   2);
                        string   s2   =   unicode.Substring(2,   2);


                        int   t1   =   Convert.ToInt32(s1,   16);
                        int   t2   =   Convert.ToInt32(s2,   16);

                        byte[]   array   =   new   byte[2];
                        array[0]   =   (byte)t1;
                        array[1]   =   (byte)t2;

                        string   s   =   System.Text.Encoding.Unicode.GetString(array);
得出的是乱码

[解决办法]
string unicode = "5df2 ";
Text = " " + (char)int.Parse(unicode, System.Globalization.NumberStyles.HexNumber);

热点排行