Problem in comparing Arabic and persian texts in django Filter

The below model has a field that takes a name and searches it in an API.

class Symbol(models.Model):
    name = models.CharField(max_length=20, unique=True, blank=False)
    sigma = models.FloatField(null=True)
    s = models.IntegerField(null=True)

The problem is that the model name property is Persian and the API content is Arabic so Django filter can't find the model object. e.g:

>> 'ي'=='ی'
>> False
# while it should be true
>> Symbol.objects.get(name="آریا") #returns nothing while it exists

I need something like localecompare() in javascript.

p.s: model data is taken from other API so I can't enter the data manually in Arabic.

Back to Top