diff --git a/src/x11/window-props.c b/src/x11/window-props.c index 0a679805d..85c03c513 100644 --- a/src/x11/window-props.c +++ b/src/x11/window-props.c @@ -635,7 +635,10 @@ reload_wm_name (MetaWindow *window, if (value->type != META_PROP_VALUE_INVALID) { - set_window_title (window, value->v.str); + g_autofree gchar *title = g_convert (value->v.str, -1, + "UTF-8", "LATIN1", + NULL, NULL, NULL); + set_window_title (window, title); meta_verbose ("Using WM_NAME for new title of %s: \"%s\"\n", window->desc, window->title); @@ -969,9 +972,13 @@ reload_wm_class (MetaWindow *window, { if (value->type != META_PROP_VALUE_INVALID) { - meta_window_set_wm_class (window, - value->v.class_hint.res_class, - value->v.class_hint.res_name); + g_autofree gchar *res_class = g_convert (value->v.class_hint.res_class, -1, + "UTF-8", "LATIN1", + NULL, NULL, NULL); + g_autofree gchar *res_name = g_convert (value->v.class_hint.res_name, -1, + "UTF-8", "LATIN1", + NULL, NULL, NULL); + meta_window_set_wm_class (window, res_class, res_name); } else {