Using national characters (ő, ű) for filtering
Using national characters (ő, ű) for filtering
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
-
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
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).