Ticket #15 (closed defect: fixed)
Default charset should be set on database connection
| Reported by: | wijnand | Owned by: | wijnand |
|---|---|---|---|
| Priority: | trivial | Milestone: | gozerbot version 0.8 |
| Component: | core | Version: | hg |
| Keywords: | db mysql charset | Cc: |
Description
There is no default collation/charset specified with the database connection, which may result in conflicting expectations.
Patch:
--- a/gozerbot/db.py 2007-08-31 09:41:42.000000000 +0200
+++ b/gozerbot/db.py 2007-09-01 21:56:07.000000000 +0200
@@ -46,7 +46,7 @@
import MySQLdb
self.connection = MySQLdb.connect(db=self.dbname, \
host=self.dbhost, user=self.dbuser, passwd=self.dbpasswd, \
-connect_timeout=self.timeout)
+connect_timeout=self.timeout, charset='utf8')
elif self.dbtype == 'sqlite':
import sqlite
self.connection = sqlite.connect(datadir + os.sep + self.dbname)
Change History
Note: See
TracTickets for help on using
tickets.
