(Go: >> BACK << -|- >> HOME <<)

I have trouble with the letters "I" and "ı"

I have trouble with the letters "I" and "ı"

canozkancanozkan Posts: 10Questions: 4Answers: 0
edited May 16 in Free community support

Link to test case: https://jsbin.com/dehakof/1/edit?html,output
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

In my table, there is a name and surname section, those whose surname is YILMAZ and those whose surname is yılmaz do not appear correctly in the search. When I write in upper case, 3 results appear, when I write in lower case, 10 results appear. What should I do to avoid problems with Turkish characters?

Answers

  • allanallan Posts: 62,217Questions: 1Answers: 10,206 Site admin

    Your example doesn't appear to run? I'm also not seeing either YILMAZ or yılmaz in the data so I can test it?

    DataTables will "normalize" diacritic characters, with the intention to make them easier to search. For example type and e and it will match e, ê, ë, etc.

    Allan

  • canozkancanozkan Posts: 10Questions: 4Answers: 0

    Hello @allan ,

    https://jsbin.com/dehakof/2/edit?html,output

    can you check new example?

  • allanallan Posts: 62,217Questions: 1Answers: 10,206 Site admin

    Thanks for the test case.

    If I search for yılmaz it shows Ahmet's row, if I search for yilmaz it shows George's row.

    The character ı does not appear to be an i with a diacritic (accent), but rather a completely different character. Forgive my ignorance of Turkish - is that expected?

    This can be confirmed in your browser's console by using "Yılmaz".normalize("NFD") which will result in Yılmaz - i.e. no accents removed.

    With your test case, waht are you expecting to happen? To type yi and have both rows show?

    Allan

  • canozkancanozkan Posts: 10Questions: 4Answers: 0
    edited May 21

    Hello @allan ,
    I solved this problem in the standard search bar used in Datatable. now the problem continues when searching in the name and surname section in the searchBuilder field. When searching with SearchBuilder, different results come when you type YILMAZ, different results come when you type yılmaz. I can show this with a different example;

    https://jsbin.com/birozek/6/edit?html,output

    In this example, when you search with SeachBuilder, different results appear in the word YILMAZ, different results appear in the word yılmaz, but both mean the same thing and mean the same thing. In Turkish, there are letters such as ğĞ, ü Ü, i İ, ı I, ş Ş, ç Ç, etc. I solved this problem in the standard search section, but I don't know how to solve this problem in the searchBuilder area.

  • allanallan Posts: 62,217Questions: 1Answers: 10,206 Site admin

    It would help me if you could tell me what your solution was, and to answer my previous question. I'm not familiar with the language, so some guidance on what is expected would be useful.

  • canozkancanozkan Posts: 10Questions: 4Answers: 0
    edited May 21

    Hello @allan ,

    https://gist.github.com/orhanerday/52a97165563bc52020cf7a49434719bc

    I had to solve the problem in the normal search bar in this way. I changed this field in the original datatable file as in the example and the problem was solved to support all Turkish characters. This example only works when searching in the normal search bar. It does not work when I search with SearchBuilder. I wonder if the case sensitivity in the SearchBuilder search is causing this problem, can we turn it off? I can prepare a special example for this problem for you if you want?

  • canozkancanozkan Posts: 10Questions: 4Answers: 0
    edited May 21

    Hello @allan ,

    I have added two different datatable js files to this example for you. When you activate the original Datatable and make a normal search, you can see that the fields containing Turkish characters are missing (you can try the Yilmaz example), then when you use the other datatable.js file that supports Turkish characters, you will see that the normal search bar opens smoothly.

    In the search bar in SearchbBuilder, you can see that it has problems with uppercase and lowercase letters in words containing Turkish characters.

    Example : https://jsbin.com/higixid/1/edit?html,output

    Note: the datatable js on my own server loads a bit late. I do the essays with the query “contains”.

Sign In or Register to comment.