Java URL Decode decode(String s)

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

Description

URL decodes the specified string using the UTF-8 character encoding.

License

Open Source License

Declaration

public static String decode(String s) 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;

import java.net.URLDecoder;

public class Main {
    /**//from   www.  j  a  v a2  s.c o  m
     * URL decodes the specified string using the UTF-8 character encoding.
     */
    public static String decode(String s) {
        try {
            return (s != null) ? URLDecoder.decode(s, "UTF-8") : null;
        } catch (UnsupportedEncodingException uee) {
            throw new RuntimeException("UTF-8 is unknown in this Java.");
        }
    }
}

Related

  1. decode(String raw)
  2. decode(String s)
  3. decode(String s)
  4. decode(String s)
  5. decode(String s)
  6. decode(String s, boolean formDecode)
  7. decode(String s, String enc)
  8. decode(String source)
  9. decode(String source, String encoding)