import java.util.Map;
import java.util.TimeZone;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
+
/**
* General purpose request parsing and encoding utility methods.
public final class RequestUtil {
+ private static final Log log = LogFactory.getLog(RequestUtil.class);
+
+ /**
+ * The string resources for this package.
+ */
+ private static final StringManager sm =
+ StringManager.getManager("org.apache.catalina.util");
+
/**
* The DateFormat to use for generating readable dates in cookies.
*/
* string is not a query string.
*
* @param str The url-encoded string
- * @param enc The encoding to use; if null, the default encoding is used
+ * @param enc The encoding to use; if null, the default encoding is used. If
+ * an unsupported encoding is specified null will be returned
* @exception IllegalArgumentException if a '%' character is not followed
* by a valid 2-digit hexadecimal number
*/
* Decode and return the specified URL-encoded String.
*
* @param str The url-encoded string
- * @param enc The encoding to use; if null, the default encoding is used
+ * @param enc The encoding to use; if null, the default encoding is used. If
+ * an unsupported encoding is specified null will be returned
* @param isQuery Is this a query string being processed
* @exception IllegalArgumentException if a '%' character is not followed
* by a valid 2-digit hexadecimal number
} else {
bytes = str.getBytes(enc);
}
- } catch (UnsupportedEncodingException uee) {}
+ } catch (UnsupportedEncodingException uee) {
+ log.debug(sm.getString("requestUtil.urlDecode.uee", enc), uee);
+ }
return URLDecode(bytes, enc, isQuery);