This is a migrated thread and some comments may be shown as answers.

accentFoldingFiltering is not working for "es-ES" culture

6 Answers 48 Views
Globalization
This is a migrated thread and some comments may be shown as answers.
Jose
Top achievements
Rank 1
Jose asked on 11 Oct 2019, 09:13 AM

An example cloned from official docs https://dojo.telerik.com/@merogos/EzEtoSuF

<!DOCTYPE html>
<br>
<html><br><head><br>    <meta charset="utf-8"/><br>    <title>Kendo UI Snippet</title><br><br>    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.917/styles/kendo.common.min.css"/><br>    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.917/styles/kendo.rtl.min.css"/><br>    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.917/styles/kendo.silver.min.css"/><br>    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.917/styles/kendo.mobile.all.min.css"/><br><br>    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script><br>    <script src="https://kendo.cdn.telerik.com/2019.3.917/js/kendo.all.min.js"></script><br></head><br><body><br>  <br><script><br>  var dataSource = new kendo.data.DataSource({<br>    data: [<br>                    {  apellido: "Lopez" },<br>                    {  apellido: "Lope" },<br>          {  apellido: "Lopito" }<br>,<br>          {  apellido: "Lopito" }<br>,<br>          {  apellido: "Lòpez" }<br>    ],<br>    filter: { field: "apellido", operator: "contains", value: "L\u00f3p" },<br>    accentFoldingFiltering: "es-ES"<br>  });<br>  dataSource.fetch(function(){<br>    var view = dataSource.view();<br>    console.log(view.length); // displays "0", should display 3<br>    console.log(view[0].apellido); // Nothing<br>  });<br></script><br></body><br></html>

 

 

6 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 14 Oct 2019, 12:39 PM

Hello Jose,

I'm not quite sure about the expectations that are listed in the comments section of the console logs. That said, let me explain how the expected behavior should - the applied filter is targeting string with a chartacters containing the "Lóp" value. Once this filter is applied against the data source - it is correct that the initial 4 results become 1 and it is the item, matching the filter string - "López".

Regards,
Nencho
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jose
Top achievements
Rank 1
answered on 14 Oct 2019, 12:51 PM

I do not understand what the "accentFoldingFiltering" property is supposed to be useful for then and what is the difference between a normal search and search with accentFoldingFiltering activated. About this question documentation stands:

"accentFoldingFiltering: It allows the filtering operation to be performed considering the diacritic characters for specific language."

That's not true. At least for "es-ES" language. "o, ó, ò" characters should be only a match, not different matches if accentFoldingFiltering is activated.

0
Jose
Top achievements
Rank 1
answered on 14 Oct 2019, 01:02 PM
i.e., tf in Turkish "Kızıltoprak" and "Kiziltoprak" are equivalent terms in Spanish "Lopez" and "López" are in the same way.
0
Jose
Top achievements
Rank 1
answered on 14 Oct 2019, 01:09 PM

In fact in SQL SERVER if you make this query:

"SELECT field1 FROM Table WHERE field1 = 'ñandú' COLLATE Traditional_Spanish_ci_ai"

returns the same rows that this one:

"SELECT field1 FROM Table WHERE field1 = 'nandu' COLLATE Traditional_Spanish_ci_ai"

or this one:

"SELECT field1 FROM Table WHERE field1 = 'Ñandu' COLLATE Traditional_Spanish_ci_ai"

I thought accentFoldingFiltering could achieve the same but it doesn't

0
Accepted
Boyan Dimitrov
Telerik team
answered on 16 Oct 2019, 12:10 PM

Hello,

The purpose of the accentFoldingFiltering option is to allow DataSource to find the exact diacritic character. For example to find only ó, but not  ò or o. In case that you want to find all kind of "o" character and return all of them you have to define a specific accent map object and use in the filter method as shown in the https://dojo.telerik.com/@boyandim/epoVudId example. 

Regards,
Boyan Dimitrov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jose
Top achievements
Rank 1
answered on 18 Oct 2019, 08:40 AM
Thank you, this solve my doubts about this.
Tags
Globalization
Asked by
Jose
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Jose
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or