--- libzvt-2.0.1.orig/libzvt/vt.c Sun Nov 3 17:51:39 2002 +++ libzvt-2.0.1/libzvt/vt.c Sun Nov 3 18:49:27 2002 @@ -1413,40 +1413,11 @@ /* XPROPERTY sets an XA_STRING in gnome-terminal and must * therefore be Latin-1 unless gnome-terminal is on crack. - * We'll assume the title/iconname are in locale encoding, since - * AFAIK they aren't tagged for encoding. xterm seems to treat - * them as locale encoding. + * The processing code automatically converts data into + * UTF-8, so we don't have to bother ourselves... */ - - if (i == VTTITLE_XPROPERTY) - { - const char *s; - GString *str; - - str = g_string_new (""); - - s = p; - while (*s) - { - g_string_append_unichar (str, *s); - ++s; - } - - utf8 = g_string_free (str, FALSE); - } - else - { - utf8 = zvt_term_locale_to_utf8 (p, -1, NULL, NULL, NULL); - /* utf8 will be NULL if the title was not valid - * in the locale encoding - */ - } - - if (utf8) - { - vt->change_my_name (vt->user_data, utf8, i); - g_free (utf8); - } + if (p) + vt->change_my_name (vt->user_data, p, i); } } } @@ -1766,8 +1737,15 @@ } else if (c==0x0a) { state = 0; /* abort command */ } else { +#ifdef HAS_I18N + if (vt->arg.txt.outptr + 6 <(vt->arg.txt.args_mem+VTPARAM_MAXARGS*VTPARAM_ARGMAX-2)) {/* truncate excessive args */ + gint len = g_unichar_to_utf8(c, vt->arg.txt.outptr); + vt->arg.txt.outptr += len; + } +#else if (vt->arg.txt.outptr<(vt->arg.txt.args_mem+VTPARAM_MAXARGS*VTPARAM_ARGMAX-2)) /* truncate excessive args */ *(vt->arg.txt.outptr)++=c; +#endif } break;