Spanish Characters in DataTables Search

Spanish Characters in DataTables Search

memememe Posts: 6Questions: 0Answers: 0
edited January 2012 in General
Hi. I'm using this wonderful plug-in and works perfectly, except by a language problem I haven't solved. I use spanish text in my mysql tables, and when I introduce a text like "Maria" in search textbox, no results appear because in my table is stored like "María", with accent on the vowel "i". How can I solve that, when I introduce "María" with accent or "Maria" without it, the search result it found it both ways.

Thanks in advance for your help.

Replies

  • MariosMarios Posts: 4Questions: 0Answers: 0
    edited January 2012
    If you are using server-side try this in the php file:
    [code]
    /*
    * Filtering
    * NOTE this does not match the built-in DataTables filtering which does it
    * word by word on any field. It's possible to do here, but concerned about efficiency
    * on very large tables, and MySQL's regex functionality is very limited
    */
    $sWhere = "";
    if ( $_GET['sSearch'] != "" )
    {
    $sWhere = "WHERE (";
    for ( $i=0 ; $i
  • memememe Posts: 6Questions: 0Answers: 0
    Thanks for your help, Marios.

    I used the server-side code you wrote, and it searchs ok, except that, in the grid, the records with accent appear like invisibles, and the rest of text (data from db) without accent, appears ok.

    Example:

    search textBox = María or Maria --> (This part OK)


    id Name Phone
    1 607897654 <- Here should show "María", but it doesn't.
    2 Mario 600123456
    3 Miguel 601345678

    How could I solve it ?

    Thanks in advance for your help
This discussion has been closed.