Here you can find the source of decode(String value)
Parameter | Description |
---|---|
RuntimeException | if there is an UnsupportedEncodingException |
public static String decode(String value)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class Main { /**/*from w w w .ja va2s . c o m*/ * Hides the irritating declared exception. * @return null if there is an IllegalArgumentException * @throws RuntimeException if there is an UnsupportedEncodingException */ public static String decode(String value) { try { return URLDecoder.decode(value, "utf-8"); } catch (UnsupportedEncodingException ex) { throw new RuntimeException(ex); } catch (IllegalArgumentException ex) { return null; } } }