From db3f287c786130fa68d73c57f08daeb8bc53aa16 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Sat, 16 May 2026 15:24:36 +0200 Subject: [PATCH] fix: transliterate message text in FullscreenMsgView before wrapping Raw UTF-8 message body was passed directly to display.print(), rendering Polish and other accented chars as garbage on the Adafruit font. Transliterating before wrapLines also fixes byte-count wrapping for multi-byte UTF-8 characters. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/ui-new/FullscreenMsgView.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-new/FullscreenMsgView.h b/examples/companion_radio/ui-new/FullscreenMsgView.h index 5db315d4..289a5344 100644 --- a/examples/companion_radio/ui-new/FullscreenMsgView.h +++ b/examples/companion_radio/ui-new/FullscreenMsgView.h @@ -51,8 +51,10 @@ struct FullscreenMsgView { display.drawTextEllipsized(2, 1, display.width() - 4, sender); display.setColor(DisplayDriver::LIGHT); + char trans_text[512]; + display.translateUTF8ToBlocks(trans_text, text, sizeof(trans_text)); char lines[12][FS_CHARS_MAX]; - int lcount = wrapLines(text, chars, lines, 12); + int lcount = wrapLines(trans_text, chars, lines, 12); int max_scroll = lcount > visible ? lcount - visible : 0; if (scroll > max_scroll) scroll = max_scroll;