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. Image for the cookie policy date

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

Hello,

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


Regards,
Radosław :)



6 Replies

MK Muneesh Kumar G Syncfusion Team 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.    
 



RK Radoslaw Kubas 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


MK Muneesh Kumar G Syncfusion Team 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. 



RK Radoslaw Kubas 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






RK Radoslaw Kubas 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?





MK Muneesh Kumar G Syncfusion Team 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.   
  
 


Loader.
Live Chat Icon For mobile
Up arrow icon