Search code examples
sql-serverasciiarabiccollation

SQL Server not difference between 'ی' and 'ي' in Arabic_CI_AS collation


I'm using ASCII function for getting equivalent ASCII code of two characters, but I'm surprised when seeing there is no difference between 'ي' and 'ی', can anyone help me?

SELECT ASCII('ي'), ASCII('ی')

Solution

  • Because your character is non Unicode you have to use UNICODE() function instead of ASCII() .

    SELECT ASCII('ي'), ASCII('ی')
    

    will result: 237, 237

    but

    SELECT UNICODE(N'ي'), UNICODE(N'ی')
    

    will result: 1610, 1740