Use common encoding routine everywhere
The string/locale manipulation in Database.py was open-coded and did not use Charset.to_utf8() like the rest of the code.
This commit is contained in:
parent
80ba4aa24f
commit
860b5737b7
|
@ -38,7 +38,6 @@ from decimal import Decimal
|
||||||
import string
|
import string
|
||||||
import re
|
import re
|
||||||
import Queue
|
import Queue
|
||||||
import codecs
|
|
||||||
|
|
||||||
# pyGTK modules
|
# pyGTK modules
|
||||||
|
|
||||||
|
@ -52,7 +51,6 @@ import Charset
|
||||||
from Exceptions import *
|
from Exceptions import *
|
||||||
|
|
||||||
log = Configuration.get_logger("logging.conf")
|
log = Configuration.get_logger("logging.conf")
|
||||||
encoder = codecs.lookup('utf-8')
|
|
||||||
|
|
||||||
class Database:
|
class Database:
|
||||||
|
|
||||||
|
@ -1561,7 +1559,7 @@ class Database:
|
||||||
|
|
||||||
def insertPlayer(self, name, site_id):
|
def insertPlayer(self, name, site_id):
|
||||||
result = None
|
result = None
|
||||||
(_name, _len) = encoder.encode(unicode(name))
|
_name = Charset.to_utf8(name)
|
||||||
c = self.get_cursor()
|
c = self.get_cursor()
|
||||||
q = "SELECT name, id FROM Players WHERE siteid=%s and name=%s"
|
q = "SELECT name, id FROM Players WHERE siteid=%s and name=%s"
|
||||||
q = q.replace('%s', self.sql.query['placeholder'])
|
q = q.replace('%s', self.sql.query['placeholder'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user