diff options
-rw-r--r-- | riscos/window.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/riscos/window.c b/riscos/window.c index dd037cc5b..88e847bd8 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -883,10 +883,24 @@ void gui_window_set_extent(struct gui_window *g, int width, int height) void gui_window_set_status(struct gui_window *g, const char *text) { + char *local_text; + if ((!g->toolbar) || (!g->toolbar->status_handle)) return; - ro_gui_set_icon_string(g->toolbar->status_handle, - ICON_STATUS_TEXT, text); + + /* convert text to local encoding */ + local_text = cnv_str_local_enc(text); + if (!local_text) { + LOG(("failed converting '%s' to local encoding", text)); + /* just use the UTF-8 text */ + ro_gui_set_icon_string(g->toolbar->status_handle, + ICON_STATUS_TEXT, text); + } + else { + ro_gui_set_icon_string(g->toolbar->status_handle, + ICON_STATUS_TEXT, local_text); + free(local_text); + } } @@ -1761,7 +1775,7 @@ bool ro_gui_window_keypress(struct gui_window *g, int key, bool toolbar) "%x (ignoring)", c)); return true; } - + /* Continuation of UTF8 character */ wc |= ((c & 0x3F) << (6 * --shift)); if (shift > 0) |