From 7f335f15b157c7c4c9620b33b15b954b5850ea89 Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Wed, 10 Aug 2022 10:34:29 +0300 Subject: [PATCH] [search] Pass search query into Core as-is without any normalization. Signed-off-by: Viktor Govako --- iphone/Maps/Core/Search/MWMSearch.mm | 6 ++++-- qt/search_panel.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/iphone/Maps/Core/Search/MWMSearch.mm b/iphone/Maps/Core/Search/MWMSearch.mm index cc626b0d56..a93998e686 100644 --- a/iphone/Maps/Core/Search/MWMSearch.mm +++ b/iphone/Maps/Core/Search/MWMSearch.mm @@ -139,7 +139,7 @@ using Observers = NSHashTable; std::string locale = (!inputLocale || inputLocale.length == 0) ? [MWMSearch manager]->m_locale : inputLocale.UTF8String; - std::string text = query.precomposedStringWithCompatibilityMapping.UTF8String; + std::string text = query.UTF8String; GetFramework().GetSearchAPI().SaveSearchQuery({std::move(locale), std::move(text)}); } @@ -151,7 +151,9 @@ using Observers = NSHashTable; if (inputLocale.length != 0) manager->m_locale = inputLocale.UTF8String; - manager->m_query = query.precomposedStringWithCompatibilityMapping.UTF8String; + // Pass input query as-is without any normalization (precomposedStringWithCompatibilityMapping). + // Otherwise № -> No, and it's unexpectable for the search index. + manager->m_query = query.UTF8String; manager->m_isCategory = (isCategory == YES); manager.textChanged = YES; diff --git a/qt/search_panel.cpp b/qt/search_panel.cpp index 55ed9ec219..4ef63d16bb 100644 --- a/qt/search_panel.cpp +++ b/qt/search_panel.cpp @@ -195,9 +195,11 @@ bool SearchPanel::TryTrafficSimplifiedColorsCmd(QString const & str) return true; } -void SearchPanel::OnSearchTextChanged(QString const & str) +void SearchPanel::OnSearchTextChanged(QString const & normalized) { - QString const normalized = str.normalized(QString::NormalizationForm_KC); + // Pass input query as-is without any normalization. + // Otherwise № -> No, and it's unexpectable for the search index. + //QString const normalized = str.normalized(QString::NormalizationForm_KC); if (Try3dModeCmd(normalized)) return;