code: public static String encode(String input)
      {
          try
          {
              return URLEncoder.encode(input, "UTF-8");
          }
          catch (UnsupportedEncodingException e)
          {
              // This never happens.
              return input;
          }
      }
docs: URL-encode the input with UTF-8.
  
  @param input
  A string to be encoded.
  
  @return
  Encoded string.