jqueryhtmljquery-select2

Why Select2 framework can not find some unicode character?


I use select2.js in mu web site .Language of my website is persian .I fill select element with this option

<select name="TrainDeparture" class="full-width select2" id="TrainDeparture">
    <option  value="165">كرج</option>   
</select>

js:

(function ($) {
    "use strict";

    $.fn.select2.locales['fa'] = {
        formatMatches: function (matches) { return matches + " نتیجه موجود است، کلیدهای جهت بالا و پایین را برای گشتن استفاده کنید."; },
        formatNoMatches: function () { return "نتیجه‌ای یافت نشد."; },
        formatInputTooShort: function (input, min) { var n = min - input.length; return "لطفاً " + n + " نویسه بیشتر وارد نمایید"; },
        formatInputTooLong: function (input, max) { var n = input.length - max; return "لطفاً " + n + " نویسه را حذف کنید."; },
        formatSelectionTooBig: function (limit) { return "شما فقط می‌توانید " + limit + " مورد را انتخاب کنید"; },
        formatLoadMore: function (pageNumber) { return "در حال بارگیری موارد بیشتر…"; },
        formatSearching: function () { return "در حال جستجو…"; }
    };

    $.extend($.fn.select2.defaults, $.fn.select2.locales['fa']);
})(jQuery);
$('.select2').select2();

When I type in search box of select2

ك

character it show message that no result found but this is wrong .

I add arabic language to my keyboard and retest . In this case select2 found words currently . Now How can i fix this?

jsbin link


Solution

  • In persian and arabic language exist number character that write same but code of this characters are not same! suach as :

    ك is arabic character

    ک is persian character

    I change this character to persian and solve.