api.py 文件源码

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

项目:roulier 作者: akretion 项目源码 文件源码
def _normalize_coerce_zpl(self, value):
        """Sanitze input for ZPL.

        Remove ZPL ctrl caraters
        Remove accents
        """
        if not isinstance(value, basestring):
            return value

        ctrl_cars = [
            0xFE,  # Tilde ~
            0x5E,  # Caret ^
            0x1E,  # RS (^ substitution)
            0x10,  # DLE (~ substitution)
        ]
        val = unidecode(value)
        for ctrl in ctrl_cars:
            val = val.replace("%c" % ctrl, "")
        return val
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号