From: Oleg Broytman Date: Thu, 11 Nov 2010 12:53:36 +0000 (+0000) Subject: Recode filename in a single-file torrent. X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=f09a1d179bd8414db9d273264d81288cf3db5b05;p=extfs.d.git Recode filename in a single-file torrent. git-svn-id: file:///home/phd/archive/SVN/mc-extfs/trunk@45 1a6e6372-1aea-0310-bd00-dc960550e1df --- diff --git a/torrent b/torrent index 712a653..825293b 100755 --- 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 = []