Here you can find the source of decode(String raw)
Decode the message by replacing all the %20 with white spaces.
Parameter | Description |
---|---|
raw | Raw data from the Web message. |
public static String decode(String raw)
//package com.java2s; //License from project: BSD License import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class Main { /**/*ww w. j av a2 s . c o m*/ * <p>Decode the message by replacing all the %20 with white spaces.</p> * * @param raw Raw data from the Web message. * * @return The actual text in regular ASCII form. */ public static String decode(String raw) { String encoded = null; try { encoded = URLDecoder.decode(raw.replaceAll("%20", " "), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return encoded; } }