summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsylvain thenault <sylvain.thenault@logilab.fr>2009-04-22 09:37:37 +0200
committersylvain thenault <sylvain.thenault@logilab.fr>2009-04-22 09:37:37 +0200
commit205371c8c9287efeedaa30d1de02982222ce1aff (patch)
tree956bf4effde0d2c5576fee824fda59c22fdb8a4c
parentd8b1bfeb9fd9a533a8f2899c4fcc65f5e867e33b (diff)
downloadlogilab-common-205371c8c9287efeedaa30d1de02982222ce1aff.tar.gz
replace policy, since mysql unicode config is a pain and is usually broken at a first glance
-rw-r--r--db.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/db.py b/db.py
index f9e694d..fb1bac1 100644
--- a/db.py
+++ b/db.py
@@ -530,7 +530,7 @@ class _MySqlDBAdapter(DBAPIAdapter):
# XXX: what about other encodings ??
if maxsize in (16777215, 50331645): # mediumtext (2**24 - 1)
if isinstance(value, str):
- return unicode(value, encoding)
+ return unicode(value, encoding, 'replace')
return value
#if maxsize == 255: # tinyblob (2**8 - 1)
# return value