Hello,
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.–
Ivo Danihelka
Index: src/video/x11/SDL_x11wm.c
RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/x11/SDL_x11wm.c,v
retrieving revision 1.10
diff -u -p -r1.10 SDL_x11wm.c
— src/video/x11/SDL_x11wm.c 4 Jan 2004 16:49:27 -0000 1.10
+++ src/video/x11/SDL_x11wm.c 28 Jun 2004 20:52:28 -0000
@@ -255,12 +255,22 @@ void X11_SetCaption(_THIS, const char *t
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);
}