Angular.js: orderBy not supported persian language

Created on 18 Apr 2016  路  5Comments  路  Source: angular/angular.js

filter orderBy not supported persian language,
orderBy ignore letters "诏 趩 倬 跇".

filters low more info broken expected use bug

All 5 comments

Could you please create a live demo (e.g. using CodePen, plnkr etc), so we can reproduce and investigate the problem ?

demo : http://codepen.io/captianhamid/pen/grzZpM
correct sort is:

  1. 丕丨賲丿
    2.倬乇賵蹖賳
    3.鬲乇丕賳賴
    4.丨賲蹖丿
    5.跇丕賱賴
    6.爻丕爻丕賳
    7.诏賵賴乇
    8.賲賴乇丕賳
    but angular ignore letters "诏 趩 倬 跇".
    more information Persian alphabet: https://en.wikipedia.org/wiki/Persian_alphabet

I have same problem.
angular ignore letters "诏 趩 倬 跇".

hi this problem for javascript. just solution overwrite sort and bind

賲賵賮賯 亘丕卮蹖丿

3

This is because of how JS orders the strings (in a locale-unaware way).
One could use String.prototype.localeCompare, but then you could get different results based on the user's locale.

Ideally, orderBy could accept a custom comparator function, so you could define your comparing logic there (and use localeCompare or whatever would produce correct results for your particular usecase).
Since this is not supported (yet :stuck_out_tongue:), you should create a custom filter.

Was this page helpful?
0 / 5 - 0 ratings