[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 <me@alex.bio>
This commit is contained in:
Alexander Borsuk
2025-06-09 23:35:08 +02:00
committed by Konstantin Pastbin
parent b6ab812e0a
commit 2ec2bf42a5

View File

@@ -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;