Here you can find the source of decodeRfc5849(final String value)
static String decodeRfc5849(final String value)
//package com.java2s; /* Utils.java// w w w . j a va2 s. c o m * * Created: 2012-10-01 (Year-Month-Day) * Character encoding: UTF-8 * ****************************************** LICENSE ******************************************* * * Copyright (c) 2012 - 2013 XIAM Solutions B.V. (http://www.xiam.nl) * * 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 { /** * The canonical character set name for {@code UTF-8}. * {@code UTF-8} is the only character set used by JSON. */ static final String UTF8 = "UTF-8"; /** * Percent decodeRfc5849 the value as specified by the RFC5849 (3.6). */ static String decodeRfc5849(final String value) { try { return URLDecoder.decode(value, UTF8); } catch (UnsupportedEncodingException ex) { throw new AssertionError(ex); // UTF-8 is always supported } } }