We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

IgnoreDiacritic does not ignore character "Ł" and "ł"

Thread ID:

Created:

Updated:

Platform:

Replies:

146434 Aug 3,2019 08:31 AM UTC Aug 8,2019 01:48 PM UTC Xamarin.Forms 6
loading
Tags: SfAutoComplete
Radoslaw Kubas
Asked On August 3, 2019 08:31 AM UTC

Hello,

It seems that Polish characters "Ł" and "ł" are not ignored. 


Regards,
Radosław :)



Muneesh Kumar G [Syncfusion]
Replied On August 5, 2019 10:26 AM UTC

Hi Radosław, 
 
Greetings from Syncfusion.  
 
We have analyzed the reported issue “IgnoreDiacritic does not ignore character ("Ł" and "ł")” from our side. "Ł" and "ł" and we would like to inform you that these characters are represented as single unicode character.  
 
And there is no following NonSpacingMark, due to that this issue occurred. And currently, we don’t have the IgnoreDiacritic support for Polish characters. 
 
Thanks,    
Muneesh Kumar G.    
 


Radoslaw Kubas
Replied On August 5, 2019 11:53 AM UTC

Hello,

Thank you for your reply. 

Do you think there is any chance to create any workaround? 

Anyway, just to confirm, others Polish characters, like "ĄąCćEęŃńÓ󌜯żŹź" works just fine. The only problem is with "Łł"

Regards,
Radek

Muneesh Kumar G [Syncfusion]
Replied On August 6, 2019 11:05 AM UTC

Hi Radosław, 
 
Thanks for your update.  
 
We have analyzed your requirement “IgnoreDiacritic does not ignore character ("Ł" and "ł")” from our side. We can achieve your requirement using the custom search in SfAutoComplete.  
 
We have prepared the sample for your reference. Please try the attached below sample and let us know if you have any concern on this. 
 
Code snippet: 
XAML code: 
<StackLayout VerticalOptions="Start"  
                 HorizontalOptions="Start"  
                 Padding="30"> 
        <autocomplete:SfAutoComplete x:Name="autoComplete" 
                                     HeightRequest="40" 
                                     AutoCompleteMode="Suggest" 
                                     SuggestionMode="Custom" 
                                     IgnoreDiacritic="False"> 
            <autocomplete:SfAutoComplete.AutoCompleteSource> 
                <ListCollection:List x:TypeArguments="x:String"> 
                    <x:String>Łogan</x:String> 
                    <x:String>Łuke</x:String> 
                    <x:String>Łevi</x:String> 
                    <x:String>Łucas</x:String> 
                    <x:String>Ĺily</x:String> 
                    <x:String>Ałdan</x:String> 
                    <x:String>Ałdrin</x:String> 
                    <x:String>Ałan</x:String> 
                </ListCollection:List> 
            </autocomplete:SfAutoComplete.AutoCompleteSource> 
        </autocomplete:SfAutoComplete> 
    </StackLayout> 
 
C#  code: 
  public partial class MainPage : ContentPage 
    { 
        public MainPage() 
        { 
            InitializeComponent(); 
            autoComplete.Filter = ContainingIgnoreDiacritic; 
        } 
 
        public bool ContainingIgnoreDiacritic(string search, object item) 
        { 
            if (item != null) 
            { 
                string text = item.ToString().ToLower(); 
                try 
                { 
                    string suggestionItem = Encoding.ASCII.GetString( 
                   Encoding.GetEncoding("ISO-8859-1").GetBytes(text) 
               ); 
                    string searchText = Encoding.ASCII.GetString( 
                   Encoding.GetEncoding("ISO-8859-1").GetBytes(search) 
               ); 
                    if (suggestionItem.Contains(searchText.ToLower())) 
                    { 
                        return true; 
                    } 
                    else 
                    { 
                        return false; 
                    } 
                    return true; 
                } 
                catch (Exception) 
                { 
                    return (text.Contains(search)); 
                } 
            } 
            else 
            { 
                return false; 
            } 
        } 
    } 
 
Sample Link: 
 
Please let us know if you have any other queries.   
 
Thanks, 
Muneesh Kumar G. 


Radoslaw Kubas
Replied On August 7, 2019 09:01 AM UTC

Hello,

Thank you very much for your hint, it helps me a lot. :) I have to say, support here is the best I've ever seen! :)

Best regards,
Radek





Radoslaw Kubas
Replied On August 7, 2019 10:14 AM UTC

Hello,

Finally I need one more advice, it works perfect, but since my suggestion list is quite large (about 50k) I noticed some performance lost. To optimise I tried to move 

string searchText = Encoding.ASCII.GetStringEncoding.GetEncoding("ISO-8859-1").GetBytes(search)

outside the 50k loop. It gives quite nice performance boost, but the problem is that i can't find good place to refresh it. If I try:

protected override void OnPropertyChanged(string propertyName = null)
{
 switch (propertyName)
 {
  case nameof(Text):
   _searchText = Encoding.ASCII.GetString(Encoding.GetEncoding("ISO-8859-1").GetBytes(Text));
   break;
 }
 base.OnPropertyChanged(propertyName);
}

it's to late. _searchText is updated after some items were compared with previous version.

Could you advice me better place or way where I can refresh encoded version of search text?




Muneesh Kumar G [Syncfusion]
Replied On August 8, 2019 01:48 PM UTC

Hi Radosław, 
 
We have analyzed your requirement “Performance issue while using the custom search in SfAutoComplete” from our side. Our SfAutoComplete control has the frame work limitation, while using this custom search. If, we change this in source level, need to change some architecture. So, we would try to implement this support in any of our release. 
 
Thanks,   
Muneesh Kumar G.   
  
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon