Index: httpclient/src/main/java/org/apache/http/client/entity/UrlEncodedFormEntity.java =================================================================== --- httpclient/src/main/java/org/apache/http/client/entity/UrlEncodedFormEntity.java (revision 1570504) +++ httpclient/src/main/java/org/apache/http/client/entity/UrlEncodedFormEntity.java (working copy) @@ -26,10 +26,6 @@ */ package org.apache.http.client.entity; -import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; -import java.util.List; - import org.apache.http.NameValuePair; import org.apache.http.annotation.NotThreadSafe; import org.apache.http.client.utils.URLEncodedUtils; @@ -37,6 +33,9 @@ import org.apache.http.entity.StringEntity; import org.apache.http.protocol.HTTP; +import java.nio.charset.Charset; +import java.util.List; + /** * An entity composed of a list of url-encoded pairs. * This is typically useful while sending an HTTP POST request. @@ -52,11 +51,10 @@ * * @param parameters list of name/value pairs * @param charset encoding the name/value pairs be encoded with - * @throws UnsupportedEncodingException if the encoding isn't supported */ public UrlEncodedFormEntity ( final List parameters, - final String charset) throws UnsupportedEncodingException { + final String charset) { super(URLEncodedUtils.format(parameters, charset != null ? charset : HTTP.DEF_CONTENT_CHARSET.name()), ContentType.create(URLEncodedUtils.CONTENT_TYPE, charset)); @@ -84,10 +82,9 @@ * of parameters with the default encoding of {@link HTTP#DEFAULT_CONTENT_CHARSET} * * @param parameters list of name/value pairs - * @throws UnsupportedEncodingException if the default encoding isn't supported */ public UrlEncodedFormEntity ( - final List parameters) throws UnsupportedEncodingException { + final List parameters) { this(parameters, (Charset) null); }