]> git.phdru.name Git - extfs.d.git/blobdiff - torrent
Recode filename in a single-file torrent.
[extfs.d.git] / 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 = []