Java URI Decode decode(String uri)

Here you can find the source of decode(String uri)

Description

decode uri by URLDecoder

License

Open Source License

Parameter

Parameter Description
uri a parameter

Declaration

public static String decode(String uri) 

Method Source Code


//package com.java2s;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

public class Main {
    /**/*from w  w  w.j a  v a  2 s .  co  m*/
     * decode uri by URLDecoder
     * @param uri
     * @return
     */
    public static String decode(String uri) {
        String newUri = uri;
        try {
            newUri = URLDecoder.decode(uri, "UTF-8");
        } catch (UnsupportedEncodingException e) {
        }
        return newUri;
    }
}

Related

  1. decode(String encodedURI)
  2. decodeToUtf8(String uri)
  3. decodeUnreserved(URI address)
  4. decodeURI(CharSequence uriCharSequence, String charset)
  5. decodeURI(java.net.URI uri)