Index: /main/trunk/greenstone3/resources/tomcat/server_tomcat8.xml.svn
===================================================================
--- /main/trunk/greenstone3/resources/tomcat/server_tomcat8.xml.svn	(revision 33042)
+++ /main/trunk/greenstone3/resources/tomcat/server_tomcat8.xml.svn	(revision 33043)
@@ -70,5 +70,6 @@
 	       port="@localhost.port.http@"  protocol="HTTP/1.1"
                connectionTimeout="20000"
-               redirectPort="@https.redirect.port@" />
+               redirectPort="@https.redirect.port@"
+			   URIEncoding="UTF-8" />
     -->
     <!-- A "Connector" using the shared thread pool-->    
@@ -96,5 +97,5 @@
     <!--
     <Connector port="@https.redirect.port@" protocol="org.apache.coyote.http11.Http11NioProtocol"
-               maxThreads="150" SSLEnabled="true">
+               maxThreads="150" SSLEnabled="true" URIEncoding="UTF-8">
         <SSLHostConfig>
             <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
@@ -111,5 +112,5 @@
     <!--
     <Connector port="@https.redirect.port@" protocol="org.apache.coyote.http11.Http11AprProtocol"
-               maxThreads="150" SSLEnabled="true" >
+               maxThreads="150" SSLEnabled="true" URIEncoding="UTF-8" >
         <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
         <SSLHostConfig>
@@ -127,5 +128,6 @@
             keystorePass="@keystore.pass@"
             clientAuth="false" sslProtocol="TLS"
-	    keystoreType="@keystore.type@" />
+	    keystoreType="@keystore.type@"
+		URIEncoding="UTF-8" />
     @https.comment.out.end@
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 33042)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 33043)
@@ -43,4 +43,6 @@
 
 import org.greenstone.gsdl3.util.MyNodeList;
+import org.greenstone.util.Misc;
+
 /** various functions for extracting info out of GS XML */
 public class GSXML
@@ -1629,5 +1631,6 @@
 	}
 
-	public static String elementToString(Element e, boolean indent)
+	// pass in debugEncoding=true to investigate encoding issues. This function will then return non-basic ASCII characters in hex
+	public static String elementToString(Element e, boolean indent, boolean debugEncoding)
 	{
 		String str = "";
@@ -1647,4 +1650,7 @@
 			trans.transform(new DOMSource(e), new StreamResult(sw));
 			str += sw.toString();
+			
+			// if debugging encoding issues, then encode unicode code pts as hex for all but non-alphanumeric and space/tab/newline chars
+			if(debugEncoding) str = Misc.stringToHex(str);
 		}
 		catch (Exception ex)
@@ -1658,4 +1664,9 @@
 	}
 
+	public static String elementToString(Element e, boolean indent)
+	{
+		return elementToString(e, indent, false);
+	}
+	
 	public static ArrayList<String> getGroupsFromSecurityResponse(Element securityResponse)
 	{
Index: /main/trunk/greenstone3/src/java/org/greenstone/util/Misc.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/util/Misc.java	(revision 33042)
+++ /main/trunk/greenstone3/src/java/org/greenstone/util/Misc.java	(revision 33043)
@@ -56,5 +56,26 @@
 	}	
     }
-
+	
+	
+	// Debugging function to print a string's non-basic chars in hex
+	// Based on https://stackoverflow.com/questions/923863/converting-a-string-to-hexadecimal-in-java
+	public static String stringToHex(String str) {
+	  String result = "";
+	  for(int i = 0; i < str.length(); i++) {
+			int charCode = str.codePointAt(i); // unicode codepoint / ASCII code
+			
+			// ASCII table: https://cdn.sparkfun.com/assets/home_page_posts/2/1/2/1/ascii_table_black.png
+			// If the unicode character code pt is less than the ASCII code for space and greater than for tilda, let's display the char in hex (x0000 format)
+			if((charCode >= 20 && charCode <= 126) || charCode == 9 || charCode == 10 || charCode == 13) { // space to tilda, TAB, LF, CR are printable
+				result += str.charAt(i);
+			} else {
+				result += "x" + String.format("%04x", charCode);
+			}
+	  }
+	  
+	  return result;
+	}
+	
+	
     public static void printHash(HashMap map) {
 	Set entries = map.entrySet();
Index: /main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js	(revision 33042)
+++ /main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js	(revision 33043)
@@ -11,4 +11,27 @@
 {
     return $("#" + id.replace(/\./g, "\\.").replace(/:/g,"\\:"));
+}
+
+// Debugging function to print a string's non-basic chars in hex
+// Based on https://stackoverflow.com/questions/36637146/javascript-encode-string-to-hex/36637293
+// https://stackoverflow.com/questions/21647928/javascript-unicode-string-to-hex
+gs.functions.string2hex = function(str) {
+	var hex, i;
+
+    var result = "";
+    for (i=0; i<str.length; i++) {
+		charcode = str.charCodeAt(i);
+		// ASCII table: https://cdn.sparkfun.com/assets/home_page_posts/2/1/2/1/ascii_table_black.png
+		// if the unicode character code pt is less than the ASCII code for space and greater than for tilda, let's display the char in hex (x0000 format)
+		if(charcode < 20 || charcode > 126) { //doesn't work: if(str.charAt(i) < ' ' || str.charAt(i) > '~') {
+			hex = charcode.toString(16);
+			result += "x" + ("000"+hex).slice(-4);
+		}
+		else {
+			result += str.charAt(i);
+		}
+    }
+
+    return result;
 }
 
