Java URL Decode decode(String value, String encoding)

Here you can find the source of decode(String value, String encoding)

Description

UnsupportedEncodingException -> value returns.

License

Open Source License

Parameter

Parameter Description
value a parameter
encoding a parameter

Declaration

static String decode(String value, String encoding) 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;

import java.net.URLDecoder;

public class Main {
    /**//  ww  w. j a  v a 2s.c om
     * UnsupportedEncodingException -> value returns.
     * @param value
     * @param encoding
     * @return
     */
    static String decode(String value, String encoding) {
        String decode = null;
        try {
            decode = URLDecoder.decode(value, encoding);
        } catch (UnsupportedEncodingException e) {
            decode = value;
        }
        return decode;
    }
}

Related

  1. decode(String value)
  2. decode(String value)
  3. decode(String value)
  4. decode(String value, String charset)
  5. decode(String value, String charset)
  6. decodeAjax(String value)
  7. decodeAjaxParam(final String source)
  8. decodeArray(final String val)
  9. decodeCodedStr(String sourceStr, String targetCharset)