Filtering on umlaut characters and other special characters

Filtering on umlaut characters and other special characters

OsirisOsiris Posts: 36Questions: 0Answers: 0
edited September 2012 in General
It seems the search isn't handling chars like 'ñ', 'ö' or 'ü' or characters with accents, resulting in zero results.
The table however displays them correctly (when not filtering).

I'm using server-side script on a mssql db.
I've added urldecode functionality to the server-side php script, but this does not improve the search.

Has anyone found a way around this ?
Should I add an encode decode system to the fnFilter function itself ?
Can something be done using the fnFilter parameters like regex ? (I haven't succeeded using these options)

I can refer to these unsolved posts :
http://datatables.net/forums/discussion/9595/how-to-filter-results-with-special-characters-using-jquery-datatables-plugin/p1
http://datatables.net/forums/discussion/6620/filtering-characters-with-accent/p1
http://datatables.net/forums/discussion/5444/how-to-modify-filter-string-prior-to-filtering/p1

Here you say that js filtering of chars is an option.
http://datatables.net/forums/discussion/1266/ignore-accent-in-the-input-typetext/p1
I however want to filter on those chars. They actually exist in the db.

Replies

  • OsirisOsiris Posts: 36Questions: 0Answers: 0
    edited September 2012
    I see 'ö' gets parsed to \xc3\xb6 somewhere ...
    Since the '%' is encoded to '\x', the php urlencode isn't doing what it should.

    Added [code]header('Content-type: text/html; charset=UTF-8');
    mb_internal_encoding('UTF-8');[/code]
    to the server-processing page just in case.
  • OsirisOsiris Posts: 36Questions: 0Answers: 0
    edited September 2012
    Found it !
    Somehow parsing the jQuery to php $_GET vars doesn't like the url encode (or something like that).

    Use utf8_decode in the server-processing.php

    This is my filtering code (where I split the search data on pipes, so ColumnFilterWidgets work server-side)

    [code] /* Filtering */
    $sWhere = "";
    if ( isset($_GET['sSearch']) && $_GET['sSearch'] != "" ) {
    $sWhere = "WHERE ( ";
    for ( $i=0 ; $i
  • MbdesignMbdesign Posts: 17Questions: 0Answers: 0
    Dear Osiris,

    if you use Serverside script how you can use ColumnFilterWidgets?

    If i try, the dropdown Filter juts use the values of the shown results.

    Markus
This discussion has been closed.