From f09a1d179bd8414db9d273264d81288cf3db5b05 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 11 Nov 2010 12:53:36 +0000 Subject: [PATCH] Recode filename in a single-file torrent. git-svn-id: file:///home/phd/archive/SVN/mc-extfs/trunk@45 1a6e6372-1aea-0310-bd00-dc960550e1df --- torrent | 2 ++ 1 file changed, 2 insertions(+) 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 = [] -- 2.39.5