Why is Turkish Lira symbol ₺ replaced with ? in SQL server 2008 database -
Why is Turkish Lira symbol ₺ replaced with ? in SQL server 2008 database -
any thought why turkish lira symbol replaced question mark when insert in table in database. see image below
this not font issue. unicode (ucs-2) vs ascii character set issue (i.e. nvarchar vs varchar). character trying utilize not exist in ascii character set (which varchar
datatype can hold). not in standard range of 0 - 127, , while might perchance in particular code-pages's set--all of in range of 128 - 255--it not in current code-page's definition since seeing ?
. can run next see yourself:
select '₺'; print '₺';
it both prints , displays in results grid ?
if want see character sql server thinks is, run following:
select ascii('₺');
and return: 63
if want see character has ascii value of 63, run this:
select char(63);
and return: ?
now run this:
select n'₺'; print n'₺';
this both print , display in results grid correctly.
to see character value symbol is, run following:
select unicode(n'₺'), unicode('₺');
this return: 8378
, 63
but isn't 63
question mark? yes. because not prefixing string literal '₺'
capital n tells sql server varchar
, gets translated default unknown character.
the way prepare is:
change datatype of fieldnvarchar
(i see in comment on question field varchar
). if field varchar
if utilize n
prefix on string, character still stored ?
. change insert statement prefix string field capital n: (73, 4, n'(3) ₺')
. if alter field nvarchar
, if don't prefix string n
sql server translate character ?
first , insert ?
. sql-server sql-server-2008 tsql unicode
Comments
Post a Comment