def unistr(text, errors='strict'):
# type: (Union[str, bytes], str) -> str
if isinstance(text, text_type):
return text
try:
return text.decode('utf-8', errors=errors)
except UnicodeDecodeError:
if HAS_FSCODEC:
return os.fsdecode(text)
raise
评论列表
文章目录