From 2ec2bf42a5acd4cebae2d55ffc11dfbbfc629309 Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Mon, 9 Jun 2025 23:35:08 +0200 Subject: [PATCH] [android] Fix crash when print log with emoji on Android 5 and 6 Warning with the unicode char code is displayed before this line Signed-off-by: Alexander Borsuk --- drape/glyph_manager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drape/glyph_manager.cpp b/drape/glyph_manager.cpp index 742da8742..3715c5caa 100644 --- a/drape/glyph_manager.cpp +++ b/drape/glyph_manager.cpp @@ -663,8 +663,10 @@ text::TextMetrics GlyphManager::ShapeText(std::string_view utf8, int fontPixelHe } while (u32CharacterIter != end); } + // Uncomment utf8 printing for debugging if necessary. It crashes JNI with non-modified UTF-8 strings on Android 5 and 6. + // See https://github.com/organicmaps/organicmaps/issues/10685 if (allGlyphs.m_glyphs.empty()) - LOG(LWARNING, ("No glyphs were found in all fonts for string", utf8)); + LOG(LWARNING, ("No glyphs were found in all fonts for string with characters in warnings above"/*, utf8*/)); // Empirically measured, may need more tuning. size_t constexpr kMaxCacheSize = 50000;