怎么通过unicode码查询到字符(汉字,日文等。。)?怎么通过区位码查到对应的汉字?
c#提供相应的函数没?

解决方案 »

  1.   

    UNICODE
    按照 Unicode 标准的定义,返回输入表达式的第一个字符的整数值。 语法
    UNICODE ( 'ncharacter_expression' )参数
    'ncharacter_expression'是 nchar 或 nvarchar 表达式。 返回类型
    int示例
    A. 使用 UNICODE 和 NCHAR
    下面的示例使用 UNICODE 和 NCHAR 函数打印 Åkergatan 24 字符串中第一个字符的 UNICODE 值,并打印实际的第一个字符 Å。DECLARE @nstring nchar(12)
    SET @nstring = N'?kergatan 24'
    SELECT UNICODE(@nstring), NCHAR(UNICODE(@nstring))下面是结果集:----------- - 
    197         ?--try
    select UNICODE ( '日' )
    select Nchar(26085)--result
    26085日
      

  2.   

    SQLSERVER 中有, C#就非常就可能有
    百度一下吧
      

  3.   

    private void TestChar() {
            char ch = 'a'; short ii = 65;
            this.textBox1.Text = "";
            this.textBox1.AppendText("The ASCII code of \'" + ch + "\' is: " + (short) ch + "\n");
            this.textBox1.AppendText("ASCII is " + ii.ToString() + ", the char is: " + (char) ii + "\n");
            char cn = '中'; short uc = 22478;
            this.textBox1.AppendText("The Unicode of \'" + cn + "\' is: " + (short) cn + "\n");
            this.textBox1.AppendText("Unicode is " + uc.ToString() + ", the char is: " + (char) uc + "\n");
        }参考
      

  4.   

    楼主注意,Unicode编码并不对应中文或日文的字符,仅仅是一种编码规则,同一个Unicode编码,在不同的字符集(代码页)下,结果是不同的。