怎么通过unicode码查询到字符(汉字,日文等。。)? 怎么通过unicode码查询到字符(汉字,日文等。。)?怎么通过区位码查到对应的汉字?c#提供相应的函数没? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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 ?--tryselect UNICODE ( '日' )select Nchar(26085)--result26085日 SQLSERVER 中有, C#就非常就可能有百度一下吧 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"); }参考 楼主注意,Unicode编码并不对应中文或日文的字符,仅仅是一种编码规则,同一个Unicode编码,在不同的字符集(代码页)下,结果是不同的。 一SQL语句问题 FCKeditors+ckfinder 上传图片预览 英文 内容修改 求助,没用接触过C#,但是工作需要做一个修改,求助!!!! 关于线程同时运行的本质 求一抽奖程序!!密码问题! 动态生成控件的问题...在线等..急!! 100分全给,求C#中反射和remoting之类的学习之经验,和通俗些的解释 c# 蓝牙编程 bluetoothclient的使用 如何发送邮件并添加附件 文本的读写速度问题 高难度题!请教 关于临时表最后一行数据求和的问题
按照 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日
百度一下吧
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");
}参考