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

Universe::findPath doesn't work with localized names #1736

Open
375gnu opened this issue Jun 25, 2023 · 2 comments
Open

Universe::findPath doesn't work with localized names #1736

375gnu opened this issue Jun 25, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@375gnu
Copy link
Collaborator

375gnu commented Jun 25, 2023

Describe the bug
Universe::findPath doesn't work with localized names even when i18n parameter is true.

To Reproduce
Steps to reproduce the behavior:

  1. Open search console.
  2. Type sol/зямля or any other full object name in your language.
  3. See that nothing is selected.

Expected behavior
Object searched should be found, e.g. Earth in the example above.

Desktop (please complete the following information):

  • OS: all
  • Frontend: all
  • Version: 1.6, 1.7.0
@375gnu 375gnu added the bug Something isn't working label Jun 25, 2023
@ajtribick
Copy link
Collaborator

ajtribick commented Jun 28, 2023

Search works fine for me when using German. I suspect the issue is that the case-insensitive searching is built on top of the standard library tolower/towlower functions, which may well be limited to the ASCII subset of characters. If so, the search would work if you capitalised the Cyrillic letters exactly the same as they are in the file.

Fix would then be to use either ICU casefolding or the string collation functions.

We should also try to eliminate the wchar stuff as much as possible in favour of Unicode types like char16_t

@375gnu
Copy link
Collaborator Author

375gnu commented Jun 28, 2023

https://en.cppreference.com/w/cpp/string/byte/tolower says that locale is taken into account:

Converts the given character to lowercase according to the character conversion rules defined by the currently installed C locale.

I'm stupid. Of course it doesn't work with multibyte encodings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants