Java URL Decode decodeString(String cookedTextString)

Here you can find the source of decodeString(String cookedTextString)

Description

Decode URL-encoded text into a raw text string.

License

Open Source License

Parameter

Parameter Description
cookedTextString A UTF-8, URI-encoded text string.

Exception

Parameter Description
UnsupportedEncodingException If the input text is not compatiblewith the UTF-8 character set.

Return

rawTextString A plain text string.

Declaration

private static String decodeString(String cookedTextString) throws UnsupportedEncodingException 

Method Source Code


//package com.java2s;
/*//  www.ja v a  2 s  .c om
 *   Copyright (C) 2009-2013 Key Bridge Global LLC and/or its affiliates.
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

public class Main {
    /**
     * Decode URL-encoded text into a raw text string.
     * <p/>
     * This method is called from within the {@link decodeVKMap} method and
     * assumes that input text has been encoded using the UTF-8 character set.
     * <p/>
     * @param cookedTextString A UTF-8, URI-encoded text string.
     * @return rawTextString A plain text string.
     * @throws UnsupportedEncodingException If the input text is not compatible
     *                                      with the UTF-8 character set.
     */
    private static String decodeString(String cookedTextString) throws UnsupportedEncodingException {
        return URLDecoder.decode(cookedTextString, "UTF-8");
    }
}

Related

  1. decodeRequestBody(String requestBody)
  2. decodeRequestString2(String inputString)
  3. decodeRfc5849(final String value)
  4. decodeSpecialMdxCharactersInNames(String name)
  5. decodeStr(String str)
  6. decodeString(String myString)
  7. decodeStringByUTF8(String str)
  8. decodeStringFields(Object objBean, String code)
  9. decodeUTF8(String s)