Here you can find the source of decode(String value)
Parameter | Description |
---|---|
value | The value to decode |
public static String decode(String value)
//package com.java2s; /**/* w ww . jav a2s . co m*/ * Copyright 2012-, Cloudsmith Inc. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not * use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class Main { private static final String QUERY_ENCODING = "UTF-8"; /** * Decode a value using the URLDecoder and UTF-8 * * @param value The value to decode * @return The decoded value. */ public static String decode(String value) { try { return URLDecoder.decode(value, QUERY_ENCODING); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } } }