I am using MS SQL 2008 Express to connect to a shared MS SQL 2008 server where I have a database. The default collation for the DB is currently SQL_Latin1_General_CP1_CI_AS
. Ultimately, I would like to store English, Korean, Chinese, and any other language imaginable in the DB. I have started off by using the following SQL code (that I found here: http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/5d2ea1a2-32e1-4a82-b6e3-17d2b898babc/) to test things out:
create table zhongwen(mingzi nvarchar(10))
go
insert into zhongwen values (N'有方')
insert into zhongwen values (N'李杰')
insert into zhongwen values (N'空炮鸡蛋')
go
select * from zhongwen
go
create procedure zhongwenfind
(@mingzi nvarchar(10))
AS
SELECT mingzi FROM zhongwen
WHERE mingzi = @mingzi
go
exec zhongwenfind N'李杰'
go
drop table zhongwen
go
drop procedure zhongwenfind
go
When I run this code in MS SQL 2008 Express, the results display only several thin boxes. If I copy a set of the thin boxes and paste them in here (the stack overflow ask a question textarea), they show up as proper characters (here I go: 空炮鸡蛋). Is it possible to set MS SQL 2008 Express to display them correctly?
Much more importantly, when I run my PHP site that is ultimately supposed to display the characters correctly to the public, I only get question marks (????). I am using mssql_query()
to query the DB. I have the following code at the top of my HTML5 HEAD:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
...and the following code in my PHP:
header('Content-Type:text/html; charset=UTF-8');
...but I only see the question marks. So, to sum it all up, 2 questions:
1) How do I make this display correctly in MS SQL 2008 Express?
2) How do I make this display correctly in PHP / HTML?
Thanks in advance!