开发者

Storing unicode strings to SQL Server via ActiveRecord

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜