ports/126294: mlterm didn`t recode menu pty list from non-unicode locale

Artemiev Igor ai at kliksys.ru
Wed Aug 6 05:30:03 UTC 2008


>Number:         126294
>Category:       ports
>Synopsis:       mlterm didn`t recode menu pty list from non-unicode locale
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 06 05:30:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Artemiev Igor
>Release:        FreeBSD 7.0-STABLE i386
>Organization:
Klik
>Environment:
System: FreeBSD one.kliksys.ru 7.0-STABLE FreeBSD 7.0-STABLE #4: Sun May 11 11:02:56 MSD 2008 root at one.kliksys.ru:/usr/obj/usr/src.7/sys/KERNEL i386
>Description:
	GTK 2.0 internally use UTF-8, but mlterm didn`t convert pty list for the menu.
	If pty name have national characters, mlterm didn`t show it in the pty selection menu 
	( invoke by Ctrl + left mouse button or Ctrl + right mouse button )
>How-To-Repeat:
	Try to change mlterm title with non-latin characters via Xterm escape sequency (\033]0;<nonlatin string>\007) and invoke mlterm menu with pty list - pty name displayed partially, only latin symbols
>Fix:
	Apply this patch:

--- contrib/tool/mlterm-menu/mlterm-menu.c.orig	2008-08-06 08:21:01.000000000 +0400
+++ contrib/tool/mlterm-menu/mlterm-menu.c	2008-08-06 08:30:00.000000000 +0400
@@ -201,6 +201,7 @@
     GtkWidget* item;
     char* pty_list;
     char* name;
+    gchar *utf8_name;
     char* pty;
     char* command;
     int is_active;
@@ -228,11 +229,12 @@
             name = pty;
         if (strncmp(name, "/dev/", 5) == 0)
             name += 5;
+	utf8_name = g_locale_to_utf8(name, -1, NULL, NULL, NULL);
 
         command = malloc(strlen(pty) + 12);
         sprintf(command, "select_pty=%s", pty);
 
-        item = gtk_radio_menu_item_new_with_label(group, name);
+        item = gtk_radio_menu_item_new_with_label(group, utf8_name);
         group = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(item));
 
         gtk_signal_connect(GTK_OBJECT(item), "toggled",
@@ -240,6 +242,7 @@
                            (gpointer) command);
 
         gtk_menu_append(menu, item);
+	g_free(utf8_name);
         if (is_active) {
             gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),
                                            TRUE);


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list