// TODO: Optimize me.
private static String encodeComponent(String s, Charset charset) {
        // TODO: Optimize me.
        try {
            return URLEncoder.encode(s, charset.name()).replace("+", "%20");
        } catch (UnsupportedEncodingException ignored) {
            throw new UnsupportedCharsetException(charset.name());
        }
    }
private static String encodeComponent(String s, Charset charset) {
// TODO: Optimize me.
try {
return URLEncoder.encode(s, charset.name()).replace("+", "%20");
private static String encodeComponent(String s, Charset charset) {
// TODO: Optimize me.
try {
return URLEncoder.encode(s, charset.name()).replace("+", "%20");
} catch (UnsupportedEncodingException ignored) {
throw new UnsupportedCharsetException(charset.name());
}
}
private static String encodeComponent(String s, Charset charset) {
// TODO: Optimize me.
try {
return URLEncoder.encode(s, charset.name()).replace("+", "%20");
} catch (UnsupportedEncodingException ignored) {
throw new UnsupportedCharsetException(charset.name());
}
}