Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class Main { private static final String DEFAULT_CONTENT_CHARSET = "ISO-8859-1"; private static String decode(final String content, final String encoding) { try { return URLDecoder.decode(content, encoding != null ? encoding : DEFAULT_CONTENT_CHARSET); } catch (UnsupportedEncodingException problem) { throw new IllegalArgumentException(problem); } } }