From b781455768a84dbd17180081a5181b3797a7ba42 Mon Sep 17 00:00:00 2001 From: humingk Date: Wed, 11 Dec 2019 17:43:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=BD=E7=95=A5=E7=BC=96=E7=A0=81=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- binlog2sql/binlog2sql_util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/binlog2sql/binlog2sql_util.py b/binlog2sql/binlog2sql_util.py index 3a9bb31..4fca957 100755 --- a/binlog2sql/binlog2sql_util.py +++ b/binlog2sql/binlog2sql_util.py @@ -139,9 +139,9 @@ def fix_object(value): if isinstance(value, set): value = ','.join(value) if PY3PLUS and isinstance(value, bytes): - return value.decode('utf-8') + return value.decode('utf-8',"ignore") elif not PY3PLUS and isinstance(value, unicode): - return value.encode('utf-8') + return value.encode('utf-8',"ignore") else: return value @@ -246,7 +246,7 @@ def reversed_lines(fin): part = '' for block in reversed_blocks(fin): if PY3PLUS: - block = block.decode("utf-8") + block = block.decode("utf-8","ignore") for c in reversed(block): if c == '\n' and part: yield part[::-1]