code: private static String urlEncodeParameter(String parameter) {
          try {
              return URLEncoder.encode(parameter, "UTF-8");
          } catch (UnsupportedEncodingException ex) {
              Logger.getLogger(XLinkUtils.class.getName()).log(Level.SEVERE, null, ex);
          }
          return parameter;
      }
docs: Encodes a given Parameter in UTF-8.