Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2015-09-01 16:25:57 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:04:11 +0300
commit6d58c2a583337f05fc310373c027232e0f3958f4 (patch)
tree6b4fc620789b5be9aba9ad146a95a563a4c54f44 /indexer/categories_holder.cpp
parent6206cdd7742d481fc45c4b5fd7389769be177ea7 (diff)
[search] Process emoji symbols like the search categories.
Diffstat (limited to 'indexer/categories_holder.cpp')
-rw-r--r--indexer/categories_holder.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/indexer/categories_holder.cpp b/indexer/categories_holder.cpp
index e1d6dd546c..d07dea2c36 100644
--- a/indexer/categories_holder.cpp
+++ b/indexer/categories_holder.cpp
@@ -150,6 +150,20 @@ void CategoriesHolder::LoadFromStream(istream & s)
else
name.m_prefixLengthToSuggest = Category::EMPTY_PREFIX_LENGTH;
+ // Process emoji symbols.
+ using namespace strings;
+ if (StartsWith(name.m_name, "U+"))
+ {
+ int c;
+ if (!to_int(name.m_name.c_str() + 2, c, 16))
+ {
+ LOG(LWARNING, ("Bad emoji code:", name.m_name));
+ continue;
+ }
+
+ name.m_name = ToUtf8(UniString(1, static_cast<UniChar>(c)));
+ }
+
cat.m_synonyms.push_back(name);
}
}