GNOME Bugzilla – Bug 95230
drag & drop is broken with non-ASCII characters
Last modified: 2004-12-22 21:47:04 UTC
[Imported from Sun's bugtraq (#4754398) gnome-terminal: drag&drop doew not work with non-ASCII characters - characters are corrupted when drag from a drag-and-drop enabled app such as CDE dtterm and drop into gnome-terminal. To reproduce: 1) run gnome-terminal, dtterm 2) type some localized characters in dtterm 3) drag&drop them to gnome-terminal 4) see corrupted characters Attaching a patch shortly - please review for check-in approval for the both branches(gnome-2-0 and HEAD).
Created attachment 11454 [details] [review] convert data back to locale's encoding before sending to terminal
This patch looks good to commit to both branches, thanks a lot.
commit to both branches with ChangeLog entry below. * src/terminal-screen.c (drag_data_received): convert drag&drop data back to locale's encoding before sending to terminal (#95230: drag&drop is broken with non-ASCII characters)
I think this change should be reverted. The XTerm spec provides control sequences for switching into and out of UTF-8 mode (the default is theoretically ISO-8859-1), and because gnome-terminal has no way of knowing which mode the terminal is in (specifically that it might not be using the same encoding glib expects), it must pass UTF-8 to the widget, and the widget must perform the correct conversion.
Nalin is right, we also have the issue of the "choose an encoding" menu on HEAD, that changes the encoding of the VTE widget. So only VTE knows its current encoding. We should pass UTF-8 to the terminal widget. For zvt, since it doesn't do anything clever, we can convert from UTF-8 in terminal-widget-zvt.c.
I see. Then, I'll back out the change from terminal-screen.c, and like to convert from UTF-8 in zvtterm.c, instead of terminal-widget-zvt.c. will apply this change to libzvt-i18n branch.
Created attachment 11462 [details] [review] back out the previous change with some comments
Commit change to libzvt-i18n branch.