mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-02 02:06:11 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
31962726ec
commit
6a7f8b7ca7
@@ -48,8 +48,10 @@ struct FullscreenMsgView {
|
|||||||
display.drawTextEllipsized(2, 1, display.width() - 4, sender);
|
display.drawTextEllipsized(2, 1, display.width() - 4, sender);
|
||||||
display.setColor(DisplayDriver::LIGHT);
|
display.setColor(DisplayDriver::LIGHT);
|
||||||
|
|
||||||
|
char trans_text[512];
|
||||||
|
display.translateUTF8ToBlocks(trans_text, text, sizeof(trans_text));
|
||||||
char lines[12][FS_CHARS + 1];
|
char lines[12][FS_CHARS + 1];
|
||||||
int lcount = wrapLines(text, lines, 12);
|
int lcount = wrapLines(trans_text, lines, 12);
|
||||||
int max_scroll = lcount > FS_VISIBLE ? lcount - FS_VISIBLE : 0;
|
int max_scroll = lcount > FS_VISIBLE ? lcount - FS_VISIBLE : 0;
|
||||||
if (scroll > max_scroll) scroll = max_scroll;
|
if (scroll > max_scroll) scroll = max_scroll;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user