SQL 排序规则和数据类型:在一个字段中支持西方和阿拉伯数据
我有一个 Delphi + SQL Server(支持 2k 或 2005)应用程序,可供西方和阿拉伯用户使用。对于某些字段(即名称),我的应用程序需要能够支持阿拉伯语言和西方语言字符。
是否可以设置单个排序规则和排序规则?处理英语或阿拉伯语数据的字段的数据类型?注意:我不需要 2 个独立的数据库,我想要一个支持两种语言的数据库。
I have a Delphi + SQL Server (2k or 2005 supported) app that is used by both western and Arabic users. For some fields (i.e. name) my app needs to be able to support both Arabic language and western language characters.
Is it possible to set a single collation & datatype for a field to handle either English or Arabic data? NB: I do not want 2 separate DB's, I want one DB that supports both languages.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ISO 8859-6(或其类似 Windows 代码页 cp1256)为您提供阿拉伯语和西方字符,其中低 128 个字符与 ASCII 相同。如果您想要非 ASCII“西方”字符(例如带重音的字母),那么您就不走运了。
不过,更好的办法是支持所有 Unicode。我不了解 Delphi,但在 SQL Server 中您会得到 NVARCHAR,这是您选择的本机 Unicode 字符串的数据类型。 (内部存储为 UTF-16LE。)
ISO 8859-6 (or its Windows codepage lookalike cp1256) gives you Arabic and Western characters in as much as the lower 128 characters are the same as ASCII. You are out of luck if you want non-ASCII ‘Western’ characters like the accented letters.
Better, though, would be to support all of Unicode. I don't know about Delphi, but in SQL Server you get NVARCHAR, which is your datatype of choice for native Unicode strings. (Stored as UTF-16LE internally.)
在sqlserver中将列类型从varchar()更改为nvarchar()
我尝试一下并运行
change type of columns from varchar() to nvarchar() in sqlserver
i try it and runin