Using national characters (ő, ű) for filtering

Using national characters (ő, ű) for filtering

szabozoltan69szabozoltan69 Posts: 3Questions: 0Answers: 0
edited December 2014 in DataTables

In the default (example) DataTables configuration it's not easy to use ő, ű (o", u") characters for data filtering. If I write something like "Gergő", it gives this error:
DataTables warning: table id=example - An SQL error occurred: SQLSTATE[HY000]: General error: 1271 Illegal mix of collations for operation 'like'.

I tried to use this: http://datatables.net/plug-ins/filtering/type-based/accent-neutralise – but did not succeed. How do I substitute $('#myInput') in the code?

Finaly I made a workaround in ssp.class.php by:

$str=str_replace(array('ő','Ő','ű','ű'),array('_','_','_','_'),$str);

(before the " LIKE ".$binding).

Is there some nicer solution?

Replies

  • szabozoltan69szabozoltan69 Posts: 3Questions: 0Answers: 0
    edited December 2014

    -

  • allanallan Posts: 63,676Questions: 1Answers: 10,497 Site admin

    Hi,

    The type based filtering plug-ins won't work if you are using server-side processing (which it looks like you are) since they are client-side scripts.

    A quick Google search for the error lead me to this page. Might that be the issue?

    Allan

  • szabozoltan69szabozoltan69 Posts: 3Questions: 0Answers: 0

    Thank you for the ideas.
    I could not heal the erroneous working of the SQL scripts in case of o", u" chars even with that COLLATE keyword. But somehow the accent-neutralise works; I substituted $(#myInput) with $(this).

This discussion has been closed.