Here you can find the source of decode(String input)
Parameter | Description |
---|---|
input | A URL encoded String |
public static String decode(String input)
//package com.java2s; //License from project: Apache License import java.net.URLDecoder; public class Main { private static String CHARSET = "UTF-8"; /** ************************************************************* * Returns a URL decoded String obtained from input, which is * assumed to be a URL encoded String composed of characters in * the default charset. In most cases, the charset will be UTF-8. *// w ww. j av a 2 s.c om * @param input A URL encoded String * * @return A String that has been URL decoded */ public static String decode(String input) { String decoded = input; try { decoded = URLDecoder.decode(input, getCharset()); } catch (Exception ex) { ex.printStackTrace(); } return decoded; } /** ************************************************************* * Returns a String denoting a character encoding scheme. The * default value is "UTF-8". * * @return String */ public static String getCharset() { return CHARSET; } }