-
Notifications
You must be signed in to change notification settings - Fork 89
Description
Hi, thanks for your cool app.
- Describe the bug
The magic search works case-sensitive if you use a language other than English.
If I start searching for a contact signed in Ukrainian, the search works only in case-sensitive English, everything works fine, case-insensitive.
- To Reproduce
Create outlines with a capital letter
Андрій
Олександр
Марія
Try to add one of the contacts to the group by writing the name with a little boova
андрій
's contact Андрій will not be found
- Expected behavior
It is expected that the contact search will work the same way as in English, case-insensitive.
I tried to fix the problem, but my knowledge wasn't good enough.
Here's what I found:
- The search is performed using regular expressions. The setupRegex function in magic-search.cpp
creates a regular expression from the search string. - The lines are reduced to lowercase. The setupRegex and getWeight functions have both a filter and a text.,
which is being searched for, converted to lowercase using tolower(). It means,
that the search should already be case insensitive.
However, there is one caveat. setupRegex uses std::regex, and getWeight uses
regex_match. By default, std::regex can be case-sensitive depending on
the compiler and OS implementation.
To ensure case insensitivity, I will add the std::regex::icase flag when
creating the std::regex object.
- Please complete the following information
- Device: RedmiNote 12
- OS: Android 13
- Version of the App 6.0.19
- Version of the SDK 5.5.0-alpha.31210+3af4d45ca2
- Where you did got it from use Play Store and build from https://github.com/BelledonneCommunications/linphone-android/
Android MIUI Global 14.0.8.
- SDK logs
Does not write any errors in the logs
- Adb logcat logs
Does not write any errors in the logs
Thank you.