为什么我不能读非英文字符? [英] Why i cant read non English characters?

查看:113
本文介绍了为什么我不能读非英文字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 创建表格temp2(

  a varchar(10), 

  b nvarchar(10)

 );

 插入temp2(a,b)

 值('גג','דד');

 create table temp2 (
  a varchar(10), 
  b nvarchar(10)
  );
  insert into temp2 (a, b)
  values ('גג','דד');

 从temp2中选择*;将显示'??'非英语字符应该在哪里。 

  select * from temp2; will show '??" where the non English characters were supposed to be. 

为什么?

推荐答案


 创建表格temp2(

  a varchar(10), 

  ; b nvarchar(10)

 );

 插入temp2(a,b)

 值('גג','דד');

 create table temp2 (
  a varchar(10), 
  b nvarchar(10)
  );
  insert into temp2 (a, b)
  values ('גג','דד');

 从temp2中选择*;将显示'??'非英语字符应该在哪里。 

  select * from temp2; will show '??" where the non English characters were supposed to be. 

为什么?

在包含Unicode字符的字符串文字之前指定前缀N.否则,文字被解释为varchar而不是nvarchar,并且排序规则中不可用的字符被转换为'?'。

Specify the prefix N before string literals that contain Unicode characters. Otherwise, the literal is interpreted as varchar instead of nvarchar and characters not available in the collation are translated to '?'.

INSERT INTO temp2 (a, b)
    VALUES (N'גג'N,'דד');


这篇关于为什么我不能读非英文字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆