Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed dump data encoding errors

  • Loading branch information...
commit fabb4a6d739175766c50a0a1cb1d7cd0a00ff572 1 parent f08a653
@mtorromeo authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 sqlantaresia/DumpTab.py
View
4 sqlantaresia/DumpTab.py
@@ -232,12 +232,14 @@ def dbworker(self):
if cell is None:
datarow.append("NULL")
elif cursor.description[i][1] in MySQLdb.BINARY:
+ if type(cell) is unicode:
+ cell = cell.encode("utf-8")
datarow.append("0x%s" % cell.encode("hex"))
elif isinstance(cell, basestring):
try:
datarow.append("'%s'" % self.connection.escapeString(cell.encode("utf-8")))
except UnicodeDecodeError:
- datarow.append("0x%s" % cell.encode("hex"))
+ datarow.append("0x%s" % cell.encode("utf-8").encode("hex"))
elif isinstance(cell, (int, long, float)):
datarow.append(str(cell))
else:
Please sign in to comment.
Something went wrong with that request. Please try again.