Merged revisions 5259 via svnmerge from

https://svn.webgui.org/plainblack/branch/WebGUI_7.4

........
  r5259 | graham | 2008-01-09 06:35:57 -0600 (Wed, 09 Jan 2008) | 1 line
  
  Use UTF8 for database connection when connecting to MySQL
........
This commit is contained in:
Graham Knop 2008-01-09 12:40:54 +00:00
parent 4b561a1a63
commit 71192f3c8b
2 changed files with 8 additions and 1 deletions

View file

@ -22,6 +22,7 @@
7.4.20
- fix: Assets with no committed versions may be left as orphans when parent is purged
- fix: Tag cloud limited was to 50 least commonly used tags
- Use UTF8 for database connection when connecting to MySQL
7.4.19
- fix: Import Package does nothing when re-importing trashed package

View file

@ -319,7 +319,13 @@ sub connect {
my $pass = shift;
my $params = shift;
my $dbh = DBI->connect($dsn,$user,$pass,{RaiseError=>0,AutoCommit=>1 });
my $driver;
if ($dsn =~ /^dbi:(\w+):/i) {
$driver = $1;
}
my $dbh = DBI->connect($dsn,$user,$pass,{RaiseError => 0, AutoCommit => 1,
$driver eq 'mysql' ? (mysql_enable_utf8 => 1) : (),
});
unless (defined $dbh) {
$session->errorHandler->error("Couldn't connect to database: $dsn");