fix remember unicode handling
This commit is contained in:
parent
e706d5aad8
commit
35d0444f13
|
@ -13,7 +13,7 @@ def get_memory(db, chan, word):
|
||||||
row = db.execute("select data from memory where chan=? and word=lower(?)",
|
row = db.execute("select data from memory where chan=? and word=lower(?)",
|
||||||
(chan, word)).fetchone()
|
(chan, word)).fetchone()
|
||||||
if row:
|
if row:
|
||||||
return row[0].encode('utf8')
|
return row[0]
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -32,7 +32,8 @@ def remember(inp, nick='', chan='', db=None):
|
||||||
" (?,lower(?),?,?)", (chan, head, head + ' ' + tail, nick))
|
" (?,lower(?),?,?)", (chan, head, head + ' ' + tail, nick))
|
||||||
db.commit()
|
db.commit()
|
||||||
if data:
|
if data:
|
||||||
return 'forgetting that %r, remembering this instead.' % data
|
return 'forgetting "%s", remembering this instead.' % \
|
||||||
|
data.replace('"', "''")
|
||||||
else:
|
else:
|
||||||
return 'done.'
|
return 'done.'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue