Changeset 2954

Show
Ignore:
Timestamp:
06/21/06 09:37:16 (16 years ago)
Author:
jerome
Message:

Ensures that the databases are created with UTF-8 encoding, and that the
client tells that we will always use UTF-8 when sending datas to the server
or retrieving them.

Location:
pykota/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/initscripts/mysql/pykota-mysql.sql

    r2903 r2954  
    3131-- Create the print quota database 
    3232-- 
    33 CREATE DATABASE pykota; 
     33CREATE DATABASE pykota DEFAULT CHARACTER SET 'utf8'; 
    3434 
    3535-- 
  • pykota/trunk/initscripts/postgresql/pykota-postgresql.sql

    r2817 r2954  
    3131-- Create the print quota database 
    3232-- 
    33 CREATE DATABASE pykota; 
     33CREATE DATABASE pykota WITH ENCODING='UTF-8'; 
    3434 
    3535-- 
  • pykota/trunk/pykota/storages/mysqlstorage.py

    r2874 r2954  
    5050        self.database.autocommit(1) 
    5151        self.cursor = self.database.cursor() 
     52        self.cursor.execute("SET NAMES 'utf8';") 
    5253        self.cursor.execute("SET TRANSACTION ISOLATION LEVEL READ COMMITTED;") # Same as PostgreSQL and Oracle's default 
    5354        self.closed = 0 
  • pykota/trunk/pykota/storages/pgstorage.py

    r2874 r2954  
    5454        self.database = pg.connect(host=host, port=port, dbname=dbname, user=user, passwd=passwd) 
    5555        self.closed = 0 
     56        self.database.query("SET CLIENT_ENCODING TO 'UTF-8';") 
    5657        self.tool.logdebug("Database opened (host=%s, port=%s, dbname=%s, user=%s)" % (host, port, dbname, user)) 
    5758