I am using Castle ActiveRecor开发者_运维知识库d as my ORM. When I try to store unicode strings, I get question marks instead.
Saving unicode strings worked perfectly when I was using mysql, but when I recently switch to SQL Server it broke. How should I go about fixing this?
You're most likely using the incorrect SQL Server data type. varchar
is meant for a plain-old character while nvarchar
is meant for Unicode characters. The same applies for char
& nchar
and text
and ntext
.
MSDN for SQL Server data type
MSDN for SQL Server Unicode data
精彩评论