Logo Search packages:      
Sourcecode: webboard version File versions  Download package

def src::webboard::WebBoard::urlencode (   self,
  data 
)
Encode all non-alphanumeric characters as hexadecimal codes

Definition at line 263 of file webboard.py.

                             :
        """Encode all non-alphanumeric characters as hexadecimal codes"""
        out = ""
        for char in data:
            if char.isalnum() or char in ['-','_']:
                out += char
            else:
                char = hex(ord(char))[2:]
                if len(char) == 1:
                    char = "0" + char
                out += "%" + char
        return out


Generated by  Doxygen 1.6.0   Back to index