url解码

欢马劈雪     最近更新时间:2020-01-02 10:19:05

498
网址解码


//package com.nowjava;

import java.io.UnsupportedEncodingException;
/*
 from NowJava.com - 时  代  Java 
*/

import java.net.URLDecoder;


public class Main {

    public static void main(String[] argv) throws Exception {

        String value = "nowjava.com";

        System.out.println(urlDecode(value));

    }


    public static String urlDecode(String value, boolean escapePlus) {

        if (escapePlus) {

            return urlDecode(value.replace("+", "%2B"));

        } else {

            return urlDecode(value);

        }

    }


    public static String urlDecode(String value) {

        if (value == null)/** 来 自 时代Java**/

            return value;

        try {

            return 
展开阅读全文