diff options
Diffstat (limited to 'desktop/browser.c')
-rw-r--r-- | desktop/browser.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/desktop/browser.c b/desktop/browser.c index 13ca3cab9..e65fa38c6 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -489,10 +489,19 @@ void browser_window_update(struct browser_window *bw, if (bw->current_content->title != NULL) { err = utf8_to_enc(bw->current_content->title, local_encoding_name(), 0, &title_local_enc); - /* this should never fail */ - assert(err == UTF8_CONVERT_OK); - gui_window_set_title(bw->window, title_local_enc); - free(title_local_enc); + if (err != UTF8_CONVERT_OK) { + /* A bad encoding should never happen, + * so assert this */ + assert(err != UTF8_CONVERT_BADENC); + LOG(("utf8_to_enc failed")); + /* use utf-8 encoded title instead */ + gui_window_set_title(bw->window, + bw->current_content->title); + } + else { + gui_window_set_title(bw->window, title_local_enc); + free(title_local_enc); + } } else gui_window_set_title(bw->window, bw->current_content->url); |