Search filter issue with Turkish characters "ı" , "İ" , "Ş" , "ş" , "Ğ" , "ğ"

Search filter issue with Turkish characters "ı" , "İ" , "Ş" , "ş" , "Ğ" , "ğ"

animacoderanimacoder Posts: 4Questions: 1Answers: 0

Hi everyone,
also Allan, are you there? :wink:

I'm getting an ajax warning when I type Turkish characters into search input. I'm looking around to finding solution for a long time. I have got a big project which includes more than 700 users. Please, save my time and customers. :smiley:

Answers

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin

    What is the response from the server? The tech note that the error message links to shows you how to get that information and other debugging information.

    Allan

  • animacoderanimacoder Posts: 4Questions: 1Answers: 0

    SQLSTATE[HY000]: General error: 1271 Illegal mix of collations for operation 'like'
    500 Internal Server Error - DBALException

    I shared a screenshot.

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin

    Sounds like your database table is a specific collation, but the data submitted is something else - probably UTF8. What is the collation of your database table?

    You could add something like:

    $db->sql("SET NAMES utf8");
    

    to force a common character set.

    Allan

  • animacoderanimacoder Posts: 4Questions: 1Answers: 0

    Thank you Allan. Your suggestion helped me but I think that It seems like a MySQL bug. If you search a string in datetime field of Mysql, It returns 500 error. When I set date columns' searchable options to false, ajax error messages did not appear.

    I solved ajax warning but I have problem with searching Turkish lower case characters. I'm trying to solve now...

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin

    If you search a string in datetime field of Mysql

    I had thought MySQL would accept that. However, is client-side processing an option for you? How many rows are in your table?

    Allan

  • animacoderanimacoder Posts: 4Questions: 1Answers: 0

    single table for datatable: ~196,687
    total records of all database: 2,333,990...

    Datatable is perfect tool for me. For this reason, I do not wanna use server-side pagination or another method. :neutral:

    I accepted MySQL bug for now. "SET NAMES utf8" method does not work for Turkish characters "ı", "ü", "ğ". I still have not found a solution :(

This discussion has been closed.