Opened 15 years ago

Closed 15 years ago

#934 closed bug (Fixed)

encoding of torrent

Reported by: bearsprite@gmail.com Owned by: andar
Priority: major Milestone:
Component: Unknown Version: 1.1.7
Keywords: Cc:

Description

1. In deluge/ui/common.py, use some code to guess a encoding, and use the encoding to convert the mbcs string to utf8 string

self.__m_name = decode_string(self.__m_metadata["info"]["name"], self.encoding)

but why not:

self.__m_name = self.__m_metadata["info"]["name.utf-8"]

field "XXXX" is a mbcs, but field "XXXX.utf-8" is just a utf8!

  1. for f in self.__m_metadata["info"]["files"]:
        self.__m_files.append({
            'path': decode_string(os.path.join(prefix, *f["path"])),
            'size': f["length"],
            'download': True
        })
    

here "prefix" is already a utf8, but f[ "path" ] is a mbcs yet, so os.path.join is invalid

Change History (1)

comment:1 by andar, 15 years ago

Resolution: fixed
Status: newclosed
  1. Not all torrents have this key, but I have added support to use it if available.
  1. I have changed it to decode/encode the path before joining it with the prefix.

In [5265].

Thanks!

Note: See TracTickets for help on using tickets.