Java tutorial
//package com.java2s; //License from project: Open Source License import java.net.URLDecoder; import android.util.Log; public class Main { private static String mLogTag = "DebugUtils"; private static boolean mIsDebug = false; public static String toURLDecoded(String paramString) { if (paramString == null || paramString.equals("")) { LogD("toURLDecoded error:" + paramString); return ""; } try { String str = new String(paramString.getBytes(), "UTF-8"); str = URLDecoder.decode(str, "UTF-8"); return str; } catch (Exception localException) { LogE("toURLDecoded error:" + paramString, localException); } return ""; } public static void LogD(String msg) { if (mIsDebug) { Log.d(mLogTag, msg); } } public static void LogE(String msg, Exception e) { Log.e(mLogTag, msg, e); e.printStackTrace(); } }