You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2012/12/27 17:20:00 UTC

svn commit: r1426242 - /httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/util/EntityUtils.java

Author: olegk
Date: Thu Dec 27 16:20:00 2012
New Revision: 1426242

URL: http://svn.apache.org/viewvc?rev=1426242&view=rev
Log:
HTTPCORE-324: EntityUtils#toString(HttpEntity, String) throws IllegalArgumentException if defaultCharset is null

Modified:
    httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/util/EntityUtils.java

Modified: httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/util/EntityUtils.java?rev=1426242&r1=1426241&r2=1426242&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/util/EntityUtils.java (original)
+++ httpcomponents/httpcore/branches/4.2.x/httpcore/src/main/java/org/apache/http/util/EntityUtils.java Thu Dec 27 16:20:00 2012
@@ -252,7 +252,7 @@ public final class EntityUtils {
      */
     public static String toString(
             final HttpEntity entity, final String defaultCharset) throws IOException, ParseException {
-        return toString(entity, Charset.forName(defaultCharset));
+        return toString(entity, defaultCharset != null ? Charset.forName(defaultCharset) : null);
     }
 
     /**