]> git.phdru.name Git - extfs.d.git/commitdiff
Recode filename in a single-file torrent.
authorOleg Broytman <phd@phdru.name>
Thu, 11 Nov 2010 12:53:36 +0000 (12:53 +0000)
committerOleg Broytman <phd@phdru.name>
Thu, 11 Nov 2010 12:53:36 +0000 (12:53 +0000)
git-svn-id: file:///home/phd/archive/SVN/mc-extfs/trunk@45 1a6e6372-1aea-0310-bd00-dc960550e1df

torrent

diff --git a/torrent b/torrent
index 712a653be9948ecf56d81c9797f70dbd7dc611c7..825293bab59d1a601abb6cb72688c273ca7bc9e8 100755 (executable)
--- a/torrent
+++ b/torrent
@@ -89,6 +89,8 @@ def mctorrent_list():
         if 'length' not in info:
             torrent_error('Unknown length')
         length = info['length']
+        if charset and encoding and (charset != encoding):
+            name = name.decode(encoding, 'replace').encode(charset, 'replace')
         paths = [(name, length)]
 
     meta = []