Characters of window title bar garbled

This commit is contained in:
Akira Nakajima 2018-10-11 07:15:22 +00:00 committed by Jonas Ådahl
parent 3faaa9ce14
commit d387aa428a
2 changed files with 6 additions and 5 deletions

View File

@ -651,10 +651,7 @@ reload_wm_name (MetaWindow *window,
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
g_autofree gchar *title = g_convert (value->v.str, -1, set_window_title (window, value->v.str);
"UTF-8", "LATIN1",
NULL, NULL, NULL);
set_window_title (window, title);
meta_verbose ("Using WM_NAME for new title of %s: \"%s\"\n", meta_verbose ("Using WM_NAME for new title of %s: \"%s\"\n",
window->desc, window->title); window->desc, window->title);

View File

@ -639,6 +639,7 @@ text_property_to_utf8 (Display *xdisplay,
{ {
char *ret = NULL; char *ret = NULL;
char **local_list = NULL; char **local_list = NULL;
const char *charset = NULL;
int count = 0; int count = 0;
int res; int res;
@ -649,7 +650,10 @@ text_property_to_utf8 (Display *xdisplay,
if (count == 0) if (count == 0)
goto out; goto out;
if (g_get_charset (&charset))
ret = g_strdup (local_list[0]); ret = g_strdup (local_list[0]);
else
ret = g_convert (local_list[0], -1, "UTF-8", charset, NULL, NULL, NULL);
out: out:
XFreeStringList (local_list); XFreeStringList (local_list);