Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Patrick on Sep 29, 2009 02:53
open dhtmlx forum
Filter on UTF8-Data

Hi,

We are currently working on the implementation of a Grid (Enterprise Edition)

And everything works well (DB, XML, Page - everything encoded in UTF8). However - when we try to filter something with a german umlaut, we don't get any data into the grid.
(XML Response <?xml version='1.0' encoding='UTF-8' ?><rows total_count='0' pos='0' ></rows>
Request was: connector=true&filter=8&col0=&col1=&col2=&col3=&col4=z%C3%BCri&col5=&col6=)

We first thought of a encoding problem but we see that the query reaches the DB:

# Query_time: 1 Lock_time: 0 Rows_sent: 1 Rows_examined: 26246
SELECT COUNT(*) FROM vw_customer_overview WHERE adr_city LIKE '%züri%';

# Query_time: 0 Lock_time: 0 Rows_sent: 0 Rows_examined: 26246
SELECT cust_id , cust_id , cust_name , adr_street , adr_postalcode , adr_city , status , lang_name FROM vw_customer_overview WHERE adr_city LIKE '%züri%' LIMIT 0,100;

So first the dataprocessor executed a count(*) which gave him back a result, then the full query was placed but the fetchrow never requested a row. We are basically using the examples that were in the package as a base.

Thank you for your help and Regards
P
Answer posted by Stanislav (support) on Oct 01, 2009 08:48
By default, component uses UTF-8 escaping for all data, which is sent to server side. It works normally in all tested cases, but it is possible that the backend logic can't process it correctly in your case. 
You may try to locate the next line inside connector.js 

inds[i]="dhx_filter["+inds[i]+"]="+encodeURIComponent(vals[i]);

and replace it as

inds[i]="dhx_filter["+inds[i]+"]="+escape(vals[i]);

In case of older version of connectors it must be 

  inds[i]="col"+inds[i]+"="+encodeURIComponent(vals[i]);
replaced with
  inds[i]="col"+inds[i]+"="+escape(vals[i]);