[PR #9943] Teach CmdPal search to use user locale #27823

Open
opened 2026-01-31 09:24:29 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/9943

State: closed
Merged: Yes


PR Checklist

Detailed Description of the Pull Request / Additional comments

The bug is due to us using std::tolower, while the default locale is not user's locale.
The fix here is to use the same approach as upon sorting: lstrcmpi.
While there are additional methods to do locale aware comparison,
here we convert chars to string and call lstrcmpi.
While this approach seems somewhat inefficient it ensures consistency
(with the order of locales that lstrcmi tries to apply internally).

**Original Pull Request:** https://github.com/microsoft/terminal/pull/9943 **State:** closed **Merged:** Yes --- ## PR Checklist * [x] Closes https://github.com/microsoft/terminal/issues/9941 * [x] CLA signed. ## Detailed Description of the Pull Request / Additional comments The bug is due to us using std::tolower, while the default locale is not user's locale. The fix here is to use the same approach as upon sorting: lstrcmpi. While there are additional methods to do locale aware comparison, here we convert chars to string and call lstrcmpi. While this approach seems somewhat inefficient it ensures consistency (with the order of locales that lstrcmi tries to apply internally).
claunia added the pull-request label 2026-01-31 09:24:29 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27823