From be6a75509d4abdd1ddc9742780e1a80e33f53917 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 7 Jun 2005 16:35:13 +0000 Subject: [project @ 2005-06-07 16:35:13 by jmb] Convert status bar text to local encoding. Fixes bug 1215998 svn path=/import/netsurf/; revision=1743 --- riscos/window.c | 20 +++++++++++++++++--- 1 file 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) -- cgit v1.2.3