Index: /main/trunk/greenstone2/perllib/gssql.pm
===================================================================
--- /main/trunk/greenstone2/perllib/gssql.pm	(revision 32558)
+++ /main/trunk/greenstone2/perllib/gssql.pm	(revision 32559)
@@ -67,5 +67,4 @@
     my $self = {
 	'collection_name' => $params_map->{'collection_name'},
-	'db_encoding' => $params_map->{'db_encoding'}
     };
 
@@ -75,4 +74,10 @@
     $self->{'tablename_prefix'} = $coll_name;
 
+    # The db_encoding option is presently not passed in to this constructor as parameter.
+    # Placed here to indicate it's sort of optional.
+    # Since docxml are all in utf8, the contents of the GS SQL database should be too,
+    # So making utf8 the hidden default at present.
+    $self->{'db_encoding'} = $params_map->{'db_encoding'} || "utf8";
+    
     return bless($self, $class);
 }
@@ -110,6 +115,6 @@
     my $self= shift (@_);
     my ($params_map) = @_;
-    #my $db_enc = $self->{'db_encoding'} || "utf8";
-    my $db_enc = "utf8mb4";
+    # For proper utf8 support in MySQL, encoding should be 'utf8mb4' as 'utf8' is insufficient
+    my $db_enc = "utf8mb4" if $self->{'db_encoding'} eq "utf8";
 
     # these are the params for connecting to MySQL
@@ -130,5 +135,5 @@
     print STDERR " - hostname $db_host; username: $db_user";
     print STDERR "; and the password provided" if $db_pwd;
-    print STDERR "Assuming the mysql server has been started with --character_set_server=utf8mb4" if $db_driver eq "mysql";
+    print STDERR "\nAssuming the mysql server has been started with: --character_set_server=utf8mb4\n" if $db_driver eq "mysql";
     
     my $dbh = DBI->connect("$connect_str", $db_user, $db_pwd,
Index: /main/trunk/greenstone2/perllib/plugins/GreenstoneSQLPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/GreenstoneSQLPlugin.pm	(revision 32558)
+++ /main/trunk/greenstone2/perllib/plugins/GreenstoneSQLPlugin.pm	(revision 32559)
@@ -146,9 +146,4 @@
 	'deft' => "127.0.0.1",
 	'reqd' => "yes"},
-      { 'name' => "db_encoding", 
-	'desc' => "{GreenstoneSQLPlug.db_encoding}",
-	'type' => "string",
-	'deft' => "utf8",
-	'reqd' => "yes"}
     ];
 
@@ -373,13 +368,12 @@
 #    print STDERR "@@@@ user: " . $self->{'db_client_user'} . "\n";
 #    print STDERR "@@@@ db_host: " . $self->{'db_host'} . "\n";
-#    print STDERR "@@@@ db_enc: " . $self->{'db_encoding'} . "\n";
 #    print STDERR "@@@@ db_driver: " . $self->{'db_driver'} . "\n";
     ####################
-    
+
+    # create gssql object.
+    # collection name will be used for naming tables (site name will be used for naming database)
     my $gs_sql = new gssql({
-	'collection_name' => $ENV{'GSDLCOLLECTION'},	
-	'db_encoding' => $self->{'db_encoding'}
-			   }
-	);
+	'collection_name' => $ENV{'GSDLCOLLECTION'}
+			   });
 
     # try connecting to the mysql db, if that fails it will die
Index: /main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm	(revision 32558)
+++ /main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm	(revision 32559)
@@ -94,9 +94,4 @@
       'type' => "string",
       'deft' => "127.0.0.1",
-      'reqd' => "yes"},
-    { 'name' => "db_encoding", 
-      'desc' => "{GreenstoneSQLPlug.db_encoding}",
-	'type' => "string",
-      'deft' => "utf8",
       'reqd' => "yes"}
     ];
@@ -136,5 +131,4 @@
     #print STDERR "@@@@ user: " . $self->{'db_client_user'} . "\n";
     #print STDERR "@@@@ db_host: " . $self->{'db_host'} . "\n";
-    #print STDERR "@@@@ db_enc: " . $self->{'db_encoding'} . "\n";
     #print STDERR "@@@@ db_driver: " . $self->{'db_driver'} . "\n";
     #print STDERR "@@@@ proc_mode: " . $self->{'process_mode'} . "\n";
@@ -147,6 +141,5 @@
 
     my $db_params = {
-	'collection_name' => $ENV{'GSDLCOLLECTION'},	
-	'db_encoding' => $self->{'db_encoding'}
+	'collection_name' => $ENV{'GSDLCOLLECTION'}	
     };
 
Index: /main/trunk/greenstone2/perllib/strings.properties
===================================================================
--- /main/trunk/greenstone2/perllib/strings.properties	(revision 32558)
+++ /main/trunk/greenstone2/perllib/strings.properties	(revision 32559)
@@ -1459,5 +1459,4 @@
 GreenstoneSQLPlug.db_client_pwd:The password with which you connect to the (My)SQL database.
 GreenstoneSQLPlug.db_host:The hostname on which the (My)SQL database server is running, 127.0.0.1 by default. Other values to try include localhost.
-GreenstoneSQLPlug.db_encoding:The encoding of the contents of the database, utf8 by default. For other options, see https://dev.mysql.com/doc/refman/5.7/en/charset-applications.html. Use the same encoding to write contents to the database with GreenstoneSQLPlugout as to read back in with GreenstoneSQLPlugin.
 
 #
