def replace_utf8mb4(self, v): """Replace 4-byte unicode characters by REPLACEMENT CHARACTER""" import re INVALID_UTF8_RE = re.compile(u'[^u0000-uD7FFuE000-uFFFF]', re.UNICODE) INVALID_UTF8_RE.sub(u'uFFFD', v)
def replace_utf8mb4(self, v): """Replace 4-byte unicode characters by REPLACEMENT CHARACTER""" import re INVALID_UTF8_RE = re.compile(u'[^u0000-uD7FFuE000-uFFFF]', re.UNICODE) INVALID_UTF8_RE.sub(u'uFFFD', v)