예제 #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, '')