def decode_Q(self, s):
        """ Decodes the file names when special characters are used (thanks to wacky)
        """
        try:
            qstart = s.index("=?") # Find the start of the Q-encoded string
            qend = s.index("?=", qstart + 2) # Find the end of it
            qenc_start = s.index("?", qstart + 2) # Find the encoding start
            qenc_end = s.index("?", qenc_start + 1) # Find the encoding end
            if s[qenc_start:qenc_end+1].upper() == "?Q?": # Q-encoded?
                enc = s[qstart+2:qenc_start] # Get the character encoding
                deQ = s[:qstart] # Get everything before the Q-encoded portion
                Qstring = s[qenc_end+1:qend] # Get the Q-encoded portion
                deQ += quopri.decodestring(Qstring, True).decode(enc) # Decode it
                deQ += s[qend+2:] # Get everything after the Q-encoded portion
                return self.decode_Q(deQ) # De-Q-code any further Q-encoded portions
            else:
                raise Exception("String is not Q-encoded: %s" % s) # It blew up
        except ValueError: # Index not found in string <s>; not Q-encoded
            return s # Returns a Unicode string
 Decodes the file names when special characters are used (thanks to wacky)
        
recipes/Python/576749_Detach_Thunderbird_emails_keep/recipe-576749.py