Index: src/edu/ucsb/nceas/metacat/DocumentImpl.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DocumentImpl.java	(revision 8958)
+++ src/edu/ucsb/nceas/metacat/DocumentImpl.java	(revision 8959)
@@ -3033,7 +3033,7 @@
      *            the server which notify local server the force replication
      *            command
      */
-    public static String writeReplication(DBConnection conn, String xmlString,
+    public static String writeReplication(DBConnection conn, String xmlString, byte[] xmlBytes,
             String pub, Reader dtd, String action, String accnum, String user,
             String[] groups, String homeServer, String notifyServer,
             String ruleBase, boolean needValidation, String tableName, 
@@ -3095,7 +3095,8 @@
                 isRevision = true;
             }
             // detect encoding
-            XmlStreamReader xsr = new XmlStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
+            //XmlStreamReader xsr = new XmlStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
+            XmlStreamReader xsr = new XmlStreamReader(new ByteArrayInputStream(xmlBytes));
 	        String encoding = xsr.getEncoding();
 	        
 	        // no need to write the EML-contained access rules for replication
@@ -3112,8 +3113,8 @@
             conn.setAutoCommit(true);
             
             // Write the file to disk
-            byte[] bytes = xmlString.getBytes(encoding);
-        	writeToFileSystem(bytes, accnum);
+            //byte[] bytes = xmlString.getBytes(encoding);
+        	writeToFileSystem(xmlBytes, accnum);
             
             // write to xml_node complete. start the indexing thread.
             // this only for xml_documents
Index: src/edu/ucsb/nceas/metacat/DocumentImplWrapper.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DocumentImplWrapper.java	(revision 8958)
+++ src/edu/ucsb/nceas/metacat/DocumentImplWrapper.java	(revision 8959)
@@ -64,7 +64,7 @@
 				ruleBase, needValidation, writeAccessRules, xmlBytes);
 	}
 
-	public String writeReplication(DBConnection conn, String xml, String pub, Reader dtd,
+	public String writeReplication(DBConnection conn, String xml, byte[]xmlBytes, String pub, Reader dtd,
 			String action, String accnum, String user, String[] groups,
 			String homeServer, String notifyServer, Date createDate, Date updateDate)
 			throws Exception {
@@ -72,7 +72,7 @@
 		// so rule base is null and need validation is false (first false)
 		// this method is for force replication. so the table name is xml_documents
 		// and timed replication is false (last false)
-		return DocumentImpl.writeReplication(conn, xml, pub, dtd, action, accnum, user,
+		return DocumentImpl.writeReplication(conn, xml, xmlBytes, pub, dtd, action, accnum, user,
 				groups, homeServer, notifyServer, ruleBase, false,
 				DocumentImpl.DOCUMENTTABLE, false, createDate, updateDate);
 		// last false means is not timed replication
@@ -96,7 +96,7 @@
 	 * @return
 	 * @throws Exception
 	 */
-	public String writeReplication(DBConnection conn, String xml, String pub, Reader dtd,
+	public String writeReplication(DBConnection conn, String xml, byte[]xmlBytes, String pub, Reader dtd,
 			String action, String accnum, String user, String[] groups,
 			String homeServer, String notifyServer, String tableName,
 			boolean timedReplication, Date createDate, Date updateDate)
@@ -103,7 +103,7 @@
 			throws Exception {
 		//we don't need to check validation in replication
 		// so rule base is null and need validation is false
-		return DocumentImpl.writeReplication(conn, xml, pub, dtd, action, accnum, user,
+		return DocumentImpl.writeReplication(conn, xml, xmlBytes, pub, dtd, action, accnum, user,
 				groups, homeServer, notifyServer, ruleBase, false, tableName,
 				timedReplication, createDate, updateDate);
 	}
Index: src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java	(revision 8958)
+++ src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java	(revision 8959)
@@ -364,7 +364,8 @@
       URL u = new URL(readDocURLString);
 
       // Get docid content
-      String newxmldoc = ReplicationService.getURLContent(u);
+      byte[] xmlBytes = ReplicationService.getURLBytes(u);
+      String newxmldoc = new String(xmlBytes, "UTF-8");
       // If couldn't get skip it
       if ( newxmldoc.indexOf("<error>")!= -1 && newxmldoc.indexOf("</error>")!=-1)
       {
@@ -444,7 +445,7 @@
       // Write the document into local host
       DocumentImplWrapper wrapper = new DocumentImplWrapper(parserBase, false, false);
       String newDocid = wrapper.writeReplication(dbConn,
-                              newxmldoc,
+                              newxmldoc, xmlBytes,
                               docinfoHash.get("public_access"),
                               null,  /* the dtd text */
                               actions,
Index: src/edu/ucsb/nceas/metacat/replication/ReplicationService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/replication/ReplicationService.java	(revision 8958)
+++ src/edu/ucsb/nceas/metacat/replication/ReplicationService.java	(revision 8959)
@@ -652,7 +652,8 @@
 			URL u = new URL("https://" + server + "?server="
 					+ MetacatUtil.getLocalReplicationServerName() + "&action=read&docid="
 					+ docid);
-			String xmldoc = ReplicationService.getURLContent(u);
+			byte[] xmlBytes = ReplicationService.getURLBytes(u);
+            String xmldoc = new String(xmlBytes, "UTF-8");
 
 			// get the document info from server
 			URL docinfourl = new URL("https://" + server + "?server="
@@ -732,7 +733,7 @@
 			DocumentImplWrapper wrapper = new DocumentImplWrapper(parserBase, false, false);
 			//try this independently so we can set access even if the update action is invalid (i.e docid has not changed)
 			try {
-				wrapper.writeReplication(dbConn, xmldoc, null, null,
+				wrapper.writeReplication(dbConn, xmldoc, xmlBytes, null, null,
 						dbaction, docid, null, null, homeServer, server, createdDate,
 						updatedDate);
 			} finally {
@@ -2275,16 +2276,8 @@
 		// get the response content
 		InputStream input = getURLStream(u);
 		logReplication.info("ReplicationService.getURLContent - After getting response from: " + u.toString());
-		InputStreamReader istream = new InputStreamReader(input);
-		StringBuffer serverResponse = new StringBuffer();
-		while ((istreamInt = istream.read()) != -1) {
-			istreamChar = (char) istreamInt;
-			serverResponse.append(istreamChar);
-		}
-		istream.close();
-		input.close();
-
-		return serverResponse.toString();
+		String content = IOUtils.toString(input, "UTF-8");
+        return content;
 	}
 	
 	/**
@@ -2306,6 +2299,18 @@
 	}
 	
 	/**
+     * This method returns a byte array after opening a url
+     * @param u the url to return the content from
+     * @return a InputStream representing the content of the url
+     * @throws java.io.IOException
+     */
+    public static byte[] getURLBytes(URL u) throws Exception {
+        InputStream input = getURLStream(u);
+        byte[] bytes = IOUtils.toByteArray(input);
+        return bytes;       
+    }
+	
+	/**
 	 * Sets up an HttpClient with SSL connection.
 	 * Sends client certificate to the server when doing the request.
 	 * @return
