# HG changeset patch # User Sam Lantinga # Date 1090776813 0 # Node ID a7a8c282d62e3305e1a2e0831c6b4b01fec263db # Parent bc0b95b02235b55a169c4fe60e1bcad16fb3da72 Date: Mon, 28 Jun 2004 23:15:55 +0200 From: Ivo Danihelka Subject: [SDL] [PATCH] SDL_WM_SetCaption with UTF-8 This patch enables UTF-8 suport for SDL_WM_SetCaption() in x11. XFree86 >= 4.0.2 supports text strings in UTF-8. Presence of this feature is indicated by the macro X_HAVE_UTF8_STRING. diff -r bc0b95b02235 -r a7a8c282d62e src/video/x11/SDL_x11wm.c --- a/src/video/x11/SDL_x11wm.c Wed Jul 21 04:53:26 2004 +0000 +++ b/src/video/x11/SDL_x11wm.c Sun Jul 25 17:33:33 2004 +0000 @@ -255,12 +255,22 @@ SDL_Lock_EventThread(); if ( title != NULL ) { +#ifdef X_HAVE_UTF8_STRING + Xutf8TextListToTextProperty(SDL_Display, (char **)&title, 1, + XUTF8StringStyle, &titleprop); +#else XStringListToTextProperty((char **)&title, 1, &titleprop); +#endif XSetWMName(SDL_Display, WMwindow, &titleprop); XFree(titleprop.value); } if ( icon != NULL ) { +#ifdef X_HAVE_UTF8_STRING + Xutf8TextListToTextProperty(SDL_Display, (char **)&icon, 1, + XUTF8StringStyle, &iconprop); +#else XStringListToTextProperty((char **)&icon, 1, &iconprop); +#endif XSetWMIconName(SDL_Display, WMwindow, &iconprop); XFree(iconprop.value); }