manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1469806 - in /manifoldcf/trunk: CHANGES.txt connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
Date Fri, 19 Apr 2013 12:38:59 GMT
Author: kwright
Date: Fri Apr 19 12:38:58 2013
New Revision: 1469806

URL: http://svn.apache.org/r1469806
Log:
Fix for CONNECTORS-675.  Fix utf-8 encoding for elasticsearch json.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1469806&r1=1469805&r2=1469806&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Apr 19 12:38:58 2013
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 1.2-dev =====================
 
+CONNECTORS-675: Fix for json UTF-8 encoding, elastic search
+connector.
+(Karl Wright)
+
 CONNECTORS-649: Adopt httpclient 4.2.4.
 (Karl Wright)
 

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java?rev=1469806&r1=1469805&r2=1469806&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
Fri Apr 19 12:38:58 2013
@@ -22,6 +22,7 @@ package org.apache.manifoldcf.agents.out
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.util.Iterator;
 
@@ -96,7 +97,7 @@ public class ElasticSearchIndex extends 
     @Override
     public void writeTo(OutputStream out)
       throws IOException {
-      PrintWriter pw = new PrintWriter(out);
+      PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, "utf-8"));
       try
       {
         pw.print("{");
@@ -134,6 +135,7 @@ public class ElasticSearchIndex extends 
         throw new IOException(e.getMessage());
       } finally
       {
+        pw.flush();
         IOUtils.closeQuietly(pw);
       }
     }



Mime
View raw message