Skip to content

Commit

Permalink
Item14207: tell MySQL that our strings are utf8
Browse files Browse the repository at this point in the history
this MySQL-specific setting seems to not impede other drivers (e.g. Pg)

also, the flag actually seems to turn on "utf-8 sensitivity", values in
a latin1 database column stay latin1 (both existing and new)
  • Loading branch information
Florian Schlichting committed Nov 2, 2016
1 parent 69ceaf5 commit 2a12b98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Foswiki/Plugins/DatabasePlugin/Connection.pm
Expand Up @@ -35,7 +35,7 @@ sub connect {
"DBI:$this->{driver}:database=$this->{database};host=$this->{hostname}$sid",
$this->{username},
$this->{password},
{ PrintError => 1, RaiseError => 1 }
{ PrintError => 1, RaiseError => 1, mysql_enable_utf8 => 1 }
);
if ( !$db ) {
die "Can't open database specified by description '$description'";
Expand Down

0 comments on commit 2a12b98

Please sign in to comment.