AngularJS and orderby in ng-repeat with special characters

angularjs, localization, sql-order-by

Solution

It's been a while, but I found other solution: fiddle

HTML:

<div ng-app='test'>
  <h2>Users</h2>
  <div ng-controller="UsersCtrl">
    <ul>
      <li ng-repeat="user in users | localeCompareString">
        {{user.surname}} {{user.name}}
      </li>
    </ul>
  </div>
</div>

JS:

(function(angular) {
  'use strict';
  var test=angular.module('test',[])
.controller('UsersCtrl', ['$scope',function($scope) {
  $scope.users = [
    {name:'Ben', surname:'Živkovič'},
    {name:'Ken', surname:'AlGore'},
    {name:'Erica', surname:'Červ'},
    {name:'Jane', surname:'Šinigoj'},
    {name:'Kevin', surname:'Sort'},
    {name:'Roger', surname:'Willson'},
    {name:'Kim', surname:'Zorro'}
];
}]).filter('localeCompareString',function(){
    return function (items) {
         //window.console.log(items);
        items.sort(function (a, b) {
            return a.surname.localeCompare(b.surname);
        });
        return items;
      }; 
});

})(window.angular);        

Problem

I am having trouble ordering strings containing characters that are not in the English alphabet ( š,č,ž,..) Here is the fiddle: http://fiddle.jshell.net/vhhgh/ The letters are from the Slovenian alphabet.

Original source