欢迎光临散文网 会员登陆 & 注册

微软在SQL Server Unicode支持情况说明中,对GB18030单独开一章节阐述(哈哈)

2023-07-05 11:41 作者:孔已乙  | 我要投稿

https://learn.microsoft.com/en-us/sql/relational-databases/collations/collation-and-unicode-support?view=sql-server-ver16#GB18030

GB18030 support

GB18030 is a separate standard that's used in the People's Republic of China for encoding Chinese characters. In GB18030, characters can be 1, 2, or 4 bytes in length. SQL Server provides support for GB18030-encoded characters by recognizing them when they enter the server from a client-side application and converting and storing them natively as Unicode characters. After they're stored in the server, they're treated as Unicode characters in any subsequent operations.

You can use any Chinese collation, preferably the latest 100 version. All version 100 collations support linguistic sorting with GB18030 characters. If the data includes supplementary characters (surrogate pairs), you can use the SC collations that are available in SQL Server to improve searching and sorting.

 Note

Ensure that your client tools, such as SQL Server Management Studio, use the Dengxian font to correctly display strings that contain GB18030-encoded characters.

最近SQL Server 2019才支持UTF-8(以前都用是UTF-16)

https://techcommunity.microsoft.com/t5/sql-server-blog/introducing-utf-8-support-for-sql-server/ba-p/734928

ALTER TABLE dbo.MyTable ALTER COLUMN MyString VARCHAR(50) COLLATE Latin1_General_100_CI_AI_SC_UTF8


微软在SQL Server Unicode支持情况说明中,对GB18030单独开一章节阐述(哈哈)的评论 (共 条)

分享到微博请遵守国家法律