Package: shutter
Version: 0.93.1-1.1
Severity: normal
Tags: l10n patch

LP: #1556021
LP: #1618310

Here I propose a patch for this problem:

From: Boyuan Yang <[email protected]>
Date: Mon, 5 Dec 2016 16:21:51 +0800
Subject: Force utf8 for retrieved window name from Gtk2.

Transform the window name retrieved from Gtk2 to utf8
to prevent messy encoding problem. Otherwise latin-1
would be used and cause mess.

This should work on most contemporary systems.

Signed-off-by: Boyuan Yang <[email protected]>
---
 bin/shutter | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/shutter b/bin/shutter
index a0495d4..38eeedd 100755
--- a/bin/shutter
+++ b/bin/shutter
@@ -30,6 +30,9 @@ use utf8;
 use strict;
 use warnings;

+#Deal with encoding problem
+use Encode;
+
 #Gnome2 libraries
 use Gnome2;
 use Gnome2::Wnck;
@@ -8624,7 +8627,9 @@ else {
         #add all windows to menu to capture it directly
         foreach my $win ( $wnck_screen->get_windows_stacked ) {
             if ( $active_workspace && $win->is_on_workspace($active_workspace)
) {
-                my $window_item = Gtk2::ImageMenuItem->new_with_label(
$win->get_name );
+                my $win_name = $win->get_name;
+                Encode::_utf8_on( $win_name );
+                my $window_item = Gtk2::ImageMenuItem->new_with_label(
$win_name );
                 foreach my $child ( $window_item->get_children ) {
                     if ( $child =~ /Gtk2::AccelLabel/ ) {
                         $child->set_width_chars(50);



-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages shutter depends on:
ii  imagemagick                        8:6.9.6.6+dfsg-1
ii  imagemagick-6.q16 [imagemagick]    8:6.9.6.6+dfsg-1
ii  libfile-basedir-perl               0.07-1
ii  libfile-copy-recursive-perl        0.38-1
ii  libfile-which-perl                 1.21-1
ii  libglib-perl                       3:1.323-1
ii  libgnome2-canvas-perl              1.002-4+b1
ii  libgnome2-gconf-perl               1.044-6+b1
ii  libgnome2-perl                     1.046-3+b1
ii  libgnome2-vfs-perl                 1.082-1+b3
ii  libgnome2-wnck-perl                0.16-3+b3
ii  libgtk2-imageview-perl             0.05-2+b3
ii  libgtk2-perl                       2:1.2499-1
ii  libgtk2-unique-perl                0.05-2+b3
ii  libimage-magick-perl [perlmagick]  8:6.9.6.6+dfsg-1
ii  libjson-perl                       2.90-1
ii  libjson-xs-perl                    3.030-1
ii  liblocale-gettext-perl             1.07-3+b1
ii  libnet-dbus-perl                   1.1.0-4+b1
ii  libnet-dropbox-api-perl            1.9-1
ii  libpath-class-perl                 0.37-1
ii  libproc-processtable-perl          0.53-2
ii  libproc-simple-perl                1.32-1
ii  librsvg2-common                    2.40.16-1
ii  libsort-naturally-perl             1.03-1
ii  libwww-mechanize-perl              1.83-1
ii  libwww-perl                        6.15-1
ii  libx11-protocol-perl               0.56-7
ii  libxml-simple-perl                 2.22-1
ii  procps                             2:3.3.12-3
ii  xdg-utils                          1.1.1-1

Versions of packages shutter recommends:
ii  libgoo-canvas-perl  0.06-2+b3

Versions of packages shutter suggests:
pn  gnome-web-photo         <none>
pn  libimage-exiftool-perl  <none>
pn  libnet-dbus-glib-perl   <none>
ii  nautilus-sendto         3.8.4-2

-- no debconf information

Reply via email to