mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 04:56:50 +03:00
[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
This commit is contained in:
parent
57b68bd933
commit
be6a75509d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user