tornado.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:SuperOcto 作者: mcecchi 项目源码 文件源码
def _extended_header_value(value):
    if not value:
        return value

    if value.lower().startswith("iso-8859-1'") or value.lower().startswith("utf-8'"):
        # RFC 5987 section 3.2
        from urllib import unquote
        encoding, _, value = value.split("'", 2)
        return unquote(octoprint.util.to_str(value, encoding="iso-8859-1")).decode(encoding)

    else:
        # no encoding provided, strip potentially present quotes and call it a day
        return octoprint.util.to_unicode(_strip_value_quotes(value), encoding="utf-8")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号