コード例 #1
0
ファイル: utils.py プロジェクト: j-howell/calibre
def encode_path(*components):
    'Encode the path specified as a list of path components using URL encoding'
    return '/' + '/'.join(urlquote(x.encode('utf-8'), '') for x in components)
コード例 #2
0
 def quoted(x):
     if not isinstance(x, (str, bytes)):
         x = str(x)
     if isinstance(x, str):
         x = x.encode('utf-8')
     return urlquote(x, '')
コード例 #3
0
ファイル: routes.py プロジェクト: onyx-Sean/calibre
 def quoted(x):
     if not isinstance(x, (unicode_type, bytes)):
         x = unicode_type(x)
     if isinstance(x, unicode_type):
         x = x.encode('utf-8')
     return urlquote(x, '')
コード例 #4
0
def encode_path(*components):
    'Encode the path specified as a list of path components using URL encoding'
    return '/' + '/'.join(urlquote(x.encode('utf-8'), '') for x in components)
コード例 #5
0
ファイル: routes.py プロジェクト: JimmXinu/calibre
 def quoted(x):
     if not isinstance(x, (unicode_type, bytes)):
         x = unicode_type(x)
     if isinstance(x, unicode_type):
         x = x.encode('utf-8')
     return urlquote(x, '')