看來AI
標誌沒有阿拉伯語的工作。您可以構建自己的Unicode規範化函數。
ALTER FUNCTION [dbo].[NormalizeUnicode]
(
-- Add the parameters for the function here
@unicodeWord nvarchar(max)
)
RETURNS nvarchar(max)
AS
BEGIN
-- Declare the return variable here
DECLARE @Result nvarchar(max)
-- Add the T-SQL statements to compute the return value here
declare @l int;
declare @i int;
SET @l = len(@unicodeWord + '-') - 1
SET @i = 1;
SET @Result = '';
WHILE (@i <= @l)
BEGIN
DECLARE @c nvarchar(1);
SET @c = SUBSTRING(@unicodeWord, @i, 1);
-- 0x064B to 0x65F, 0x0670 are Combining Characters
-- You may need to perform tests for this character range
IF NOT (unicode(@c) BETWEEN 0x064B AND 0x065F or unicode(@c) = 0x0670)
SET @Result = @Result + @c;
SET @i = @i + 1;
END
-- Return the result of the function
RETURN @Result
END
以下測試應能正常工作,
select 1
where dbo.NormalizeUnicode(N'بِسمِ اللہِ الرَّحمٰنِ الرَّحیم') = dbo.NormalizeUnicode(N'بسم اللہ الرحمن الرحیم');
注:
- 您可能會遇到性能下降與此解決方案
- 我已經在使用的字符範圍功能未經徹底測試。
- 有關阿拉伯Unicode字符集的完整參考,請參閱本文檔中之間在我的例子字符串http://www.unicode.org/charts/PDF/U0600.pdf
真正唯一的區別是,第一個具有不同於第二個阿拉伯語變音符號和我想到的是那些相等使用不符號變音不敏感整理! – ARZ