开发者

Storing unicode strings to SQL Server via ActiveRecord

开发者 https://www.devze.com 2022-12-30 06:45 出处:网络
I am using Castle ActiveRecor开发者_运维知识库d as my ORM. When I try to store unicode strings, I get question marks instead.

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

精彩评论

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