Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search does not handle some special characters #47

Open
spicamelot opened this issue Sep 5, 2022 · 1 comment
Open

Search does not handle some special characters #47

spicamelot opened this issue Sep 5, 2022 · 1 comment

Comments

@spicamelot
Copy link

Hello,

I am filtering a list of users by using a search pattern and NinjaNye.SearchExtensions 3.0.1.
One of the user has a special character within its name ( the literal Æ )
The search returns all expected results but the user with the special character.

Here is my code :

string pattern = "";

var coaches = context.Coaches.Search(t => t.UserName.ToLower())
                                                .Containing(pattern.ToLower())
                                                .OrderBy(c => c.UserName);

// a row is missing in the coaches variable.

@Crusader2010
Copy link

Crusader2010 commented Nov 21, 2023

What's the point of searching for an empty string? Why not just return the whole list of users?
Also, does your database collation properly handle special (unicode) characters? Is it set to be case sensitive or not (if not, you don't need the .ToLower() )?

Try the query directly from SQL and see if you get that user's name. Here are some hints or things you can use: https://stackoverflow.com/questions/4251765/how-to-use-like-statement-with-unicode-strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants