예제 #1
0
 /** 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));
 }
예제 #2
0
 /**
  * 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);
 }