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
评论列表
文章目录