Bug fixed: Cannot load non-utf8 encoding torrent
Posted: Fri Apr 24, 2009 2:50 pm
open file "/usr/lib/python2.6/site-packages/deluge/ui/common.py"
switch to line 71.
modify the "prefix" variable as below.
In my opinion, the self.__m_metadata["info"]["name"] and file path should be in the same encoding format.
AND, BTW: a few torrent files use the "codepage" instead of the standard "encoding" keyword, you'd better use some hex editor (sucha as GHex) to modify the torrent file, just replace the "codepage" to "encoding" and replace the value of "codepage" from int to string.
switch to line 71.
modify the "prefix" variable as below.
Code: Select all
self.__m_files = []
if self.__m_metadata["info"].has_key("files"):
prefix = ""
if len(self.__m_metadata["info"]["fil[url][/url]es"]) > 1:
# prefix = self.__m_metadata["info"]["name"].decode(self.encoding).encode("utf8")
prefix = self.__m_metadata["info"]["name"]
for f in self.__m_metadata["info"]["files"]:
self.__m_files.append({
'path': os.path.join(prefix, *f["path"]).decode(self.encoding).encode("utf8"),
'size': f["length"],
'download': True
})
AND, BTW: a few torrent files use the "codepage" instead of the standard "encoding" keyword, you'd better use some hex editor (sucha as GHex) to modify the torrent file, just replace the "codepage" to "encoding" and replace the value of "codepage" from int to string.