/** Encodes {@code s} using the {@link Charset} named by {@code charsetName}. */ public static String encode(String s, String charsetName) throws UnsupportedEncodingException { return ENCODER.encode(s, Charset.forName(charsetName)); }
/** * Equivalent to {@code encode(s, "UTF-8")}. * * @deprecated use {@link #encode(String, String)} instead. */ @Deprecated public static String encode(String s) { return ENCODER.encode(s, Charsets.UTF_8); }