如何在 SQL Server 数据库中使用 UTF-8 排序规则?

2021-12-28 00:00:00 utf-8 sql-server

我已经将数据库从 mysql 迁移到 SQL Server(政治),使用 UTF8 的原始 mysql 数据库.

I've migrated a database from mysql to SQL Server (politics), original mysql database using UTF8.

现在我阅读了https://dba.stackexchange.com/questions/7346/sql-server-2005-2008-utf-8-collat​​ion-charset SQL Server 2008 不支持utf8,这是开玩笑吗?

Now I read https://dba.stackexchange.com/questions/7346/sql-server-2005-2008-utf-8-collation-charset that SQL Server 2008 doesn't support utf8, is this a joke?

SQL Server 托管多个数据库,大部分是拉丁文编码的.由于迁移的数据库用于网络发布,因此我想保留 utf8 编码.我是否遗漏了什么,或者我是否需要在应用程序级别进行编码/解码?

The SQL Server hosts multiple databases, mostly Latin-encoded. Since the migrated db is intended for web publishing, I want to keep the utf8-encoding. Have I missed something or do I need to enc/dec at application level?

推荐答案

不!这不是开玩笑.

看看这里:http://msdn.microsoft.com/en-us/library/ms186939.aspx

固定长度、nchar 或可变长度、nvarchar、Unicode 数据并使用 UNICODE UCS-2字符集.

Character data types that are either fixed-length, nchar, or variable-length, nvarchar, Unicode data and use the UNICODE UCS-2 character set.

还有这里:http://en.wikipedia.org/wiki/UTF-16

较旧的 UCS-2(2 字节通用字符集)是类似的在 2.0 版中被 UTF-16 取代的字符编码1996 年 7 月的 Unicode 标准.

The older UCS-2 (2-byte Universal Character Set) is a similar character encoding that was superseded by UTF-16 in version 2.0 of the Unicode standard in July 1996.

相关文章