def _cleanup_param(self, val, strip=True): # Get rid of any weird control chars value = re.sub(r"[\x00-\x08\x0e-\x1f]", " ", val) value = _unicode(value) if strip: value = value.strip() return unquote(value)