Here you can find the source of decodeString(String cookedTextString)
Parameter | Description |
---|---|
cookedTextString | A UTF-8, URI-encoded text string. |
Parameter | Description |
---|---|
UnsupportedEncodingException | If the input text is not compatiblewith the UTF-8 character set. |
private static String decodeString(String cookedTextString) throws UnsupportedEncodingException
//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"); } }