cloudjun

导航

web application input & display chinese characters

The backend database is sql server 2000.

1) in web.config, set encoding to utf-8
2) in sql server, set field type to nchar, nvarchar or ntext
3) in the application data access layer, if using stored procedure, just set the input/output parameter to nchar, nvarchar or ntext; if using plain sql, use sth like "insert into employee_table(names, age) values(N'myname', 22)"

sql server will change uft-8 to ucs-2 and vise versa automatically.

posted on 2006-04-19 13:46  jun  阅读(480)  评论(0编辑  收藏  举报