manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1354345 - in /manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf: ManifoldCFQParserPlugin.java ManifoldCFSearchComponent.java
Date Wed, 27 Jun 2012 07:07:09 GMT
Author: kwright
Date: Wed Jun 27 07:07:08 2012
New Revision: 1354345

URL: http://svn.apache.org/viewvc?rev=1354345&view=rev
Log:
HttpClient 4.1 does not seem to detect charset very well, so default to utf-8 if it doesn't.
 Part of CONNECTORS-485.

Modified:
    manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
    manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java

Modified: manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java?rev=1354345&r1=1354344&r2=1354345&view=diff
==============================================================================
--- manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
(original)
+++ manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
Wed Jun 27 07:07:08 2012
@@ -285,7 +285,10 @@ public class ManifoldCFQParserPlugin ext
         InputStream is = httpResponse.getEntity().getContent();
         try
         {
-          Reader r = new InputStreamReader(is,EntityUtils.getContentCharSet(httpResponse.getEntity()));
+          String charSet = EntityUtils.getContentCharSet(httpResponse.getEntity());
+          if (charSet == null)
+            charSet = "utf-8";
+          Reader r = new InputStreamReader(is,charSet);
           try
           {
             BufferedReader br = new BufferedReader(r);

Modified: manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java?rev=1354345&r1=1354344&r2=1354345&view=diff
==============================================================================
--- manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
(original)
+++ manifoldcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
Wed Jun 27 07:07:08 2012
@@ -94,7 +94,10 @@ public class ManifoldCFSearchComponent e
     super.init(args);
     authorityBaseURL = (String)args.get("AuthorityServiceBaseURL");
     if (authorityBaseURL == null)
+    {
+      System.out.println("USING DEFAULT BASE URL!!");
       authorityBaseURL = "http://localhost:8345/mcf-authority-service";
+    }
     Integer timeOut = (Integer)args.get("SocketTimeOut");
     socketTimeOut = timeOut == null ? 300000 : timeOut;
     String allowAttributePrefix = (String)args.get("AllowAttributePrefix");
@@ -304,7 +307,10 @@ public class ManifoldCFSearchComponent e
       InputStream is = httpResponse.getEntity().getContent();
       try
       {
-        Reader r = new InputStreamReader(is,EntityUtils.getContentCharSet(httpResponse.getEntity()));
+        String charSet = EntityUtils.getContentCharSet(httpResponse.getEntity());
+        if (charSet == null)
+          charSet = "utf-8";
+        Reader r = new InputStreamReader(is,charSet);
         try
         {
           BufferedReader br = new BufferedReader(r);



Mime
View raw message