This commit is contained in:
Kovid Goyal 2024-05-27 17:31:12 +05:30
parent 5cf6498bc9
commit bed99fc552
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -48,7 +48,7 @@ all_author_searches = AUTHOR_SEARCHES.__iter__
def qquote(val, use_plus=True): def qquote(val, use_plus=True):
if not isinstance(val, bytes): if not isinstance(val, bytes):
val = val.encode('utf-8') val = val.encode('utf-8', 'replace')
ans = quote_plus(val) if use_plus else quote(val) ans = quote_plus(val) if use_plus else quote(val)
if isinstance(ans, bytes): if isinstance(ans, bytes):
ans = ans.decode('utf-8') ans = ans.decode('utf-8')