public static String decode(String value) { if (StringUtils.isEmpty(value)) { return ""; } try { return URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
public static String encode(String value) { if (StringUtils.isEmpty(value)) { return ""; } try { return URLEncoder.encode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
public static String encode(String value) { if (StringUtils.isEmpty(value)) { return ""; } try { return URLEncoder.encode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
public static String decode(String value) { if (StringUtils.isEmpty(value)) { return ""; } try { return URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
@SuppressWarnings("deprecation") private String decodeQueryParam(String value) { try { return URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException ex) { if (logger.isWarnEnabled()) { logger.warn(getLogPrefix() + "Could not decode query value [" + value + "] as 'UTF-8'. " + "Falling back on default encoding: " + ex.getMessage()); } return URLDecoder.decode(value); } }
public static String read(InputStream in) { InputStreamReader reader; try { reader = new InputStreamReader(in, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e.getMessage(), e); } return read(reader); }
public static String urlDecode(String value) { if (StringUtils.isBlank(value)) { return ""; } try { return URLDecoder.decode(value, MotanConstants.DEFAULT_CHARACTER); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
public static String urlEncode(String value) { if (StringUtils.isEmpty(value)) { return ""; } try { return URLEncoder.encode(value, MotanConstants.DEFAULT_CHARACTER); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
private String encodeValue(String value) { String ret; try { ret = URLEncoder.encode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e.getMessage()); } return ret; }
public String getDecodedParameter(String key, String defaultValue) { String value = getParameter(key, defaultValue); if (value != null && value.length() > 0) { try { value = URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { logger.error(e.getMessage(), e); } } return value; }
public String getDecodedParameter(String key, String defaultValue) { String value = getParameter(key, defaultValue); if (value != null && value.length() > 0) { try { value = URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { logger.error(e.getMessage(), e); } } return value; }
public static String decode(String value) { if (value == null || value.length() == 0) { return ""; } try { return URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
public static String encode(String value) { if (value == null || value.length() == 0) { return ""; } try { return URLEncoder.encode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
public static String print2String(byte minbinMsg[]) { ByteArrayOutputStream os = new ByteArrayOutputStream(); MBPrinter.printMessage(minbinMsg, new PrintStream(os)); try { return os.toString("UTF8"); } catch (UnsupportedEncodingException e) { return e.getMessage(); } }
public static String encode(String value) { if (value == null || value.length() == 0) { return ""; } try { return URLEncoder.encode(value, UTF8_ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
public static String encode(String value) { if (value == null || value.length() == 0) { return ""; } try { return URLEncoder.encode(value, UTF8_ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
public static String decode(String value) { if (value == null || value.length() == 0) { return ""; } try { return URLDecoder.decode(value, UTF8_ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } }
public String encode(ConnectionProxy connection, String s) throws SQLException { try { CharsetConvert charsetConvert = (CharsetConvert) connection.getAttribute(ATTR_CHARSET_CONVERTER); return charsetConvert.encode(s); } catch (UnsupportedEncodingException e) { throw new SQLException(e.getMessage(), e); } }
public String decode(ConnectionProxy connection, String s) throws SQLException { try { CharsetConvert charsetConvert = (CharsetConvert) connection.getAttribute(ATTR_CHARSET_CONVERTER); return charsetConvert.decode(s); } catch (UnsupportedEncodingException e) { throw new SQLException(e.getMessage(), e); } }
@SuppressWarnings("deprecation") private String decodeQueryParam(String value) { try { return URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException ex) { if (logger.isWarnEnabled()) { logger.warn(getLogPrefix() + "Could not decode query value [" + value + "] as 'UTF-8'. " + "Falling back on default encoding: " + ex.getMessage()); } return URLDecoder.decode(value); } }