summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-08-05 11:02:33 +0000
committerOle Loots <ole@monochrom.net>2011-08-05 11:02:33 +0000
commita8b9f0936f89ff23dbca86727fa5134fd4e2c39a (patch)
tree840b5c5c05d8b3ee9f3cbe0c68026a97fbdc9a52
parentcc52da39f7d5b3c4998aecdc890c560d824a5d25 (diff)
downloadnetsurf-a8b9f0936f89ff23dbca86727fa5134fd4e2c39a.tar.gz
netsurf-a8b9f0936f89ff23dbca86727fa5134fd4e2c39a.tar.bz2
Convert window title to local encoding.
svn path=/trunk/netsurf/; revision=12638
-rwxr-xr-xatari/gui.c11
1 files changed, 10 insertions, 1 deletions
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 );
}