From 0bcfdbeb50b2435b848ea1fd50ccc79ba64fd129 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 7 Jun 2005 21:29:26 +0000 Subject: [project @ 2005-06-07 21:29:26 by jmb] Lose cnv_str_local_enc and friends. UTF-8 conversion functions now return an enumerated type allowing for fallbacks, if appropriate. svn path=/import/netsurf/; revision=1744 --- desktop/browser.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 49d81dadd..13ca3cab9 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -41,6 +41,7 @@ #include "netsurf/utils/talloc.h" #include "netsurf/utils/url.h" #include "netsurf/utils/utils.h" +#include "netsurf/utils/utf8.h" /** browser window which is being redrawn. Valid only during redraw. */ @@ -480,12 +481,16 @@ void browser_window_update(struct browser_window *bw, char *title_local_enc; struct box *pos; int x, y; + utf8_convert_ret err; if (!bw->current_content) return; - if (bw->current_content->title != NULL - && (title_local_enc = cnv_str_local_enc(bw->current_content->title)) != NULL) { + 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); } else -- cgit v1.2.3