Package: rtorrent
Version: 0.6.2-2
Severity: wishlist

Hi.
I hope the rtorrent can support the UTF-8 in displaying the
wide character.

I checked the src/display/window_file_list.cc and
found the author wrote the code.

I just used the hack_wstring() and change the path print.
It needs the libnursesw5 to compile.

Please examine the attached patch. I hope this can be supported

Best Regards,
Asho Yeh


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-2-686
Locale: LANG=zh_TW.UTF-8, LC_CTYPE=zh_TW.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to zh_TW.UTF-8)

Versions of packages rtorrent depends on:
ii  libc6                        2.3.6.ds1-4 GNU C Library: Shared libraries
ii  libcomerr2                   1.39-1      common error description library
ii  libcurl3                     7.15.5-1    Multi-protocol file transfer libra
ii  libgcc1                      1:4.1.1-13  GCC support library
ii  libidn11                     0.6.5-1     GNU libidn library, implementation
ii  libkrb53                     1.4.4-3     MIT Kerberos runtime libraries
ii  libncurses5                  5.5-3       Shared libraries for terminal hand
ii  libsigc++-2.0-0c2a           2.0.17-2    type-safe Signal Framework for C++
ii  libssl0.9.8                  0.9.8c-3    SSL shared libraries
ii  libstdc++6                   4.1.1-13    The GNU Standard C++ Library v3
ii  libtorrent9                  0.10.2-1    a C++ BitTorrent library
ii  zlib1g                       1:1.2.3-13  compression library - runtime

rtorrent recommends no packages.

-- no debconf information
diff -Nur rtorrent-0.6.2/debian/control rtorrent-0.6.2-mod/debian/control
--- rtorrent-0.6.2/debian/control       2006-10-27 11:08:40.000000000 +0800
+++ rtorrent-0.6.2-mod/debian/control   2006-10-27 11:01:44.686785750 +0800
@@ -3,7 +3,7 @@
 Priority: extra
 Maintainer: Jose Luis Rivas <[EMAIL PROTECTED]>
 Uploaders: Arnaud Fontaine <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 5.0.37.2), libtorrent9-dev(>= 0.10.1), 
libsigc++-2.0-dev, libcurl3-openssl-dev, libncurses5-dev, bc
+Build-Depends: debhelper (>= 5.0.37.2), libtorrent9-dev(>= 0.10.1), 
libsigc++-2.0-dev, libcurl3-openssl-dev, libncursesw5-dev, bc
 Standards-Version: 3.7.2
 
 Package: rtorrent
diff -Nur rtorrent-0.6.2/src/display/window_file_list.cc 
rtorrent-0.6.2-mod/src/display/window_file_list.cc
--- rtorrent-0.6.2/src/display/window_file_list.cc      2006-10-27 
11:08:40.000000000 +0800
+++ rtorrent-0.6.2-mod/src/display/window_file_list.cc  2006-10-27 
11:00:45.171066250 +0800
@@ -55,6 +55,7 @@
 }
 
 
+
 std::wstring
 hack_wstring(const std::string& src) {
   size_t length = ::mbstowcs(NULL, src.c_str(), src.size());
@@ -70,7 +71,6 @@
   return dest;
 }
 
-
 void
 WindowFileList::redraw() {
   m_slotSchedule(this, (cachedTime + 
rak::timer::from_seconds(10)).round_seconds());
@@ -100,10 +100,10 @@
   while (range.first != range.second) {
     torrent::File e = fl.get(range.first);
 
-    std::wstring path = e.path_str();
+    std::wstring path = hack_wstring(e.path_str());
 
     if (path.length() <= 50)
-      path = path + std::string(50 - path.length(), ' ');
+      path = path + std::wstring(50 - path.length(), ' ');
     else
       path = path.substr(0, 50);
 
@@ -127,7 +127,7 @@
       break;
     };
 
-    m_canvas->print(0, pos, "%c %s  %6.1f   %s   %3d  %9s",
+    m_canvas->print(0, pos, "%c %ls  %6.1f   %s   %3d  %9s",
                     range.first == *m_focus ? '*' : ' ',
                     path.c_str(),
                     (double)e.size_bytes() / (double)(1 << 20),

Reply via email to