Skip to content

Commit

Permalink
Fix utf-8 (Cyrillic) on DOGLCD
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 18, 2024
1 parent 2fd7c2b commit 429af69
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Marlin/src/lcd/lcdprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in
int8_t n = maxlen;
while (n > 0) {
lchar_t wc;
uint8_t *psc = (uint8_t *)p;
p = get_utf8_value_cb(p, read_byte_rom, wc);
if (!wc) break;
if (wc == '{' || wc == '~' || wc == '*') {
Expand Down Expand Up @@ -90,9 +89,15 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in
}
else {
if (wc == '@')
*o++ = AXIS_CHAR(ind);
*o = AXIS_CHAR(ind);
else if (wc > 255 && prop == 2) {
// Wide glyph support incomplete
*((uint16_t*)o) = wc;
++o;
}
else
while (psc != p) *o++ = read_byte_rom(psc++);
*o = wc;
++o;
*o = '\0';
n--;
}
Expand Down

0 comments on commit 429af69

Please sign in to comment.