From a8b9f0936f89ff23dbca86727fa5134fd4e2c39a Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Fri, 5 Aug 2011 11:02:33 +0000 Subject: Convert window title to local encoding. svn path=/trunk/netsurf/; revision=12638 --- atari/gui.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/atari/gui.c b/atari/gui.c index d19a234c6..466ae2e99 100755 --- a/atari/gui.c +++ b/atari/gui.c @@ -314,10 +314,19 @@ void gui_window_get_dimensions(struct gui_window *w, int *width, int *height, void gui_window_set_title(struct gui_window *gw, const char *title) { + int l; + char * conv; + if (gw == NULL) return; if( gw->root ){ - strncpy(gw->root->title, title, atari_sysinfo.aes_max_win_title_len); + l = strlen(title); + if( utf8_to_local_encoding(title, l, &conv) == UTF8_CONVERT_OK ){ + strncpy(gw->root->title, conv, atari_sysinfo.aes_max_win_title_len); + free( conv ); + } else { + strncpy(gw->root->title, title, atari_sysinfo.aes_max_win_title_len); + } gw->root->title[atari_sysinfo.aes_max_win_title_len] = 0; WindSetStr( gw->root->handle, WF_NAME, gw->root->title ); } -- cgit v1.2.3