src/video/x11/SDL_x11wm.c
changeset 1505 4d005dfbb7f5
parent 1402 d910939febfa
child 1558 b46bb79cc197
     1.1 --- a/src/video/x11/SDL_x11wm.c	Mon Mar 13 01:20:05 2006 +0000
     1.2 +++ b/src/video/x11/SDL_x11wm.c	Mon Mar 13 01:33:58 2006 +0000
     1.3 @@ -255,8 +255,13 @@
     1.4  				&titleprop);
     1.5  #endif
     1.6  		if ( error != Success ) {
     1.7 -			pXStringListToTextProperty((char **)&title, 1,
     1.8 -					&titleprop);
     1.9 +			char *title_latin1 = SDL_iconv_utf8_latin1((char *)title);
    1.10 +			if ( !title_latin1 ) {
    1.11 +				SDL_OutOfMemory();
    1.12 +				return;
    1.13 +			}
    1.14 +			pXStringListToTextProperty(&title_latin1, 1, &titleprop);
    1.15 +			SDL_free(title_latin1);
    1.16  		}
    1.17  		pXSetWMName(SDL_Display, WMwindow, &titleprop);
    1.18  		pXFree(titleprop.value);
    1.19 @@ -268,7 +273,13 @@
    1.20  				(char **)&icon, 1, XUTF8StringStyle, &iconprop);
    1.21  #endif
    1.22  		if ( error != Success ) {
    1.23 -			pXStringListToTextProperty((char **)&icon, 1, &iconprop);
    1.24 +			char *icon_latin1 = SDL_iconv_utf8_latin1((char *)title);
    1.25 +			if ( !icon_latin1 ) {
    1.26 +				SDL_OutOfMemory();
    1.27 +				return;
    1.28 +			}
    1.29 +			pXStringListToTextProperty(&icon_latin1, 1, &iconprop);
    1.30 +			SDL_free(icon_latin1);
    1.31  		}
    1.32  		pXSetWMIconName(SDL_Display, WMwindow, &iconprop);
    1.33  		pXFree(iconprop.value);