code: def url_quote_part (s, safechars='/', encoding=None):
      
      if isinstance(s, unicode):
          if encoding is None:
              encoding = url_encoding
          s = s.encode(encoding, 'ignore')
      return urllib.quote(s, safechars)
docs: Wrap urllib.quote() to support unicode strings. A unicode string
      is first converted to UTF-8. After that urllib.quote() is called.