#2163: .torrent encoding ("Unknown encoding")
----------------------+-----------------------------------------------------
 Reporter:  NicolaiS  |       Owner:  Cas     
     Type:  bug       |      Status:  assigned
 Priority:  trivial   |   Milestone:  1.3.6   
Component:  core      |     Version:  1.3.5   
 Keywords:  encoding  |  
----------------------+-----------------------------------------------------
Changes (by Cas):

  * owner:  => Cas
  * status:  new => assigned
  * version:  other (please specify) => 1.3.5
  * type:  feature-request => bug
  * milestone:  Future => 1.3.6


Comment:

 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

-- 
Ticket URL: <https://dev.deluge-torrent.org/ticket/2163#comment:2>
Deluge <http://deluge-torrent.org/>
Deluge project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-dev?hl=en.

Reply via email to