From d1d524aab186d75e2fc6e8dfbe17cf172478a2d8 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Sat, 16 May 2026 15:11:12 +0200 Subject: [PATCH] fix: apply UTF-8 transliteration in drawTextEllipsized Names printed via drawTextEllipsized (contacts, senders) bypassed translateUTF8ToBlocks, causing raw UTF-8 bytes to render as garbage on the Adafruit font. Now transliteration happens inside the method. Co-Authored-By: Claude Sonnet 4.6 --- src/helpers/ui/DisplayDriver.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/helpers/ui/DisplayDriver.h b/src/helpers/ui/DisplayDriver.h index 61432a8b..86dcdfc9 100644 --- a/src/helpers/ui/DisplayDriver.h +++ b/src/helpers/ui/DisplayDriver.h @@ -110,10 +110,7 @@ public: // draw text with ellipsis if it exceeds max_width virtual void drawTextEllipsized(int x, int y, int max_width, const char* str) { char temp_str[256]; // reasonable buffer size - size_t len = strlen(str); - if (len >= sizeof(temp_str)) len = sizeof(temp_str) - 1; - memcpy(temp_str, str, len); - temp_str[len] = 0; + translateUTF8ToBlocks(temp_str, str, sizeof(temp_str)); if (getTextWidth(temp_str) <= max_width) { setCursor(x, y);