Opened 12 years ago
Closed 12 years ago
#2163 closed bug (Fixed)
.torrent encoding ("Unknown encoding")
Reported by: | NicolaiS | Owned by: | Calum |
---|---|---|---|
Priority: | trivial | Milestone: | 1.3.6 |
Component: | Core | Version: | 1.3.5 |
Keywords: | encoding | Cc: |
Description
If a torrent file have the "8:encoding" tag, but doesn't specify how the file is encoded ("0:"), then deluge gives an "Invalid File - Unknown encoding: " error.
Torrent files shouldn't be looking like this:
13:creation date i1292357935e 8:encoding '''0:''' 4:info ...
( they should be looking like this: )
13:creation date i1347442918e 8:encoding '''5:UTF-8''' 4:info ...
But lately I've seen a few with "8:encoding0:" I know how to manually fix this, but most end-users don't, so a default encoding of UTF-8 (in case of the encoding == "") would be preferred.
More info: Deluge doesn't give this error, if the "8:encoding" isn't there.
Tested on: Deluge 1.3.5 (libtorrent 0.15.10.0)
Attachments (2)
Change History (6)
by , 12 years ago
Attachment: | Pioneer.One.S01E01.REDUX.Xvid-VODO.torrent added |
---|
by , 12 years ago
Attachment: | Pioneer.One.S01E01.REDUX.Xvid-VODO.2.torrent added |
---|
Valid torrent (same torrent, with encoding=UTF8)
comment:1 by , 12 years ago
If a torrent file have the "8:encoding" tag, but doesn't specify how the file is encoded ("0:"), then deluge gives an "Invalid File - Unknown encoding: " error.
Torrent files shouldn't be looking like this:
13:creation date i1292357935e 8:encoding 0: 4:info ...
( they should be looking like this: )
13:creation date i1347442918e 8:encoding 5:UTF-8 4:info ...
But lately I've seen a few with "8:encoding0:" I know how to manually fix this, but most end-users don't, so a default encoding of UTF-8 (in case of the encoding == "") would be preferred.
More info: Deluge doesn't give this error, if the "8:encoding" isn't there.
Tested on: Deluge 1.3.5 (libtorrent 0.15.10.0)
comment:2 by , 12 years ago
Milestone: | Future → 1.3.6 |
---|---|
Owner: | set to |
Status: | new → assigned |
Type: | feature-request → bug |
Version: | other (please specify) → 1.3.5 |
Here is proposed fix for deluge/ui/common.py
:
@@ -75,11 +75,13 @@ self.__m_info_hash = sha(bencode.bencode(self.__m_metadata["info"])).hexdigest() # Get encoding from torrent file if available - self.encoding = "UTF-8" + self.encoding = None if "encoding" in self.__m_metadata: self.encoding = self.__m_metadata["encoding"] elif "codepage" in self.__m_metadata: self.encoding = str(self.__m_metadata["codepage"]) + if not self.encoding: + self.encoding = "UTF-8" # Check if 'name.utf-8' is in the torrent and if not try to decode the string # using the encoding found.
There was a similar issue in a forum post: http://forum.deluge-torrent.org/viewtopic.php?f=7&t=41147
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Invalid torrent