Changeset 32559 for main/trunk/greenstone2/perllib/gssql.pm
- Timestamp:
- 2018-10-31T19:48:18+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/gssql.pm
r32558 r32559 67 67 my $self = { 68 68 'collection_name' => $params_map->{'collection_name'}, 69 'db_encoding' => $params_map->{'db_encoding'}70 69 }; 71 70 … … 75 74 $self->{'tablename_prefix'} = $coll_name; 76 75 76 # The db_encoding option is presently not passed in to this constructor as parameter. 77 # Placed here to indicate it's sort of optional. 78 # Since docxml are all in utf8, the contents of the GS SQL database should be too, 79 # So making utf8 the hidden default at present. 80 $self->{'db_encoding'} = $params_map->{'db_encoding'} || "utf8"; 81 77 82 return bless($self, $class); 78 83 } … … 110 115 my $self= shift (@_); 111 116 my ($params_map) = @_; 112 # my $db_enc = $self->{'db_encoding'} || "utf8";113 my $db_enc = "utf8mb4" ;117 # For proper utf8 support in MySQL, encoding should be 'utf8mb4' as 'utf8' is insufficient 118 my $db_enc = "utf8mb4" if $self->{'db_encoding'} eq "utf8"; 114 119 115 120 # these are the params for connecting to MySQL … … 130 135 print STDERR " - hostname $db_host; username: $db_user"; 131 136 print STDERR "; and the password provided" if $db_pwd; 132 print STDERR " Assuming the mysql server has been started with --character_set_server=utf8mb4" if $db_driver eq "mysql";137 print STDERR "\nAssuming the mysql server has been started with: --character_set_server=utf8mb4\n" if $db_driver eq "mysql"; 133 138 134 139 my $dbh = DBI->connect("$connect_str", $db_user, $db_pwd,
Note:
See TracChangeset
for help on using the changeset viewer.