Storycraft: attempt at handling unicode properly
This commit is contained in:
parent
56bd5a687b
commit
cdb7a58240
|
@ -1024,7 +1024,7 @@ class Storycraft(Module):
|
||||||
line.id = result['id']
|
line.id = result['id']
|
||||||
line.game_id = result['game_id']
|
line.game_id = result['game_id']
|
||||||
line.player_id = result['player_id']
|
line.player_id = result['player_id']
|
||||||
line.line = result['line']
|
line.line = result['line'].encode('utf-8', 'replace')
|
||||||
line.time = result['time']
|
line.time = result['time']
|
||||||
|
|
||||||
lines.append(line)
|
lines.append(line)
|
||||||
|
@ -1043,7 +1043,7 @@ class Storycraft(Module):
|
||||||
statement = '''
|
statement = '''
|
||||||
UPDATE storycraft_line SET line = ?, time = CURRENT_TIMESTAMP WHERE id = ?
|
UPDATE storycraft_line SET line = ?, time = CURRENT_TIMESTAMP WHERE id = ?
|
||||||
'''
|
'''
|
||||||
cur.execute(statement, (input_line, line_id))
|
cur.execute(statement, (input_line.decode('utf-8', 'replace'), line_id))
|
||||||
db.commit()
|
db.commit()
|
||||||
return line_id
|
return line_id
|
||||||
except sqlite3.Error as e:
|
except sqlite3.Error as e:
|
||||||
|
|
Loading…
Reference in New Issue