Here you can find the source of decodeB64_TO_UTF8(String encodedStr)
public static String decodeB64_TO_UTF8(String encodedStr) throws UnsupportedEncodingException, ScriptException
//package com.java2s; /**// www . j a va 2 s. c om * License: https://github.com/votingsystem/votingsystem/wiki/Licencia */ import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import java.io.*; import java.util.Base64; public class Main { public static String decodeB64_TO_UTF8(String encodedStr) throws UnsupportedEncodingException, ScriptException { String decodeStr = new String(Base64.getDecoder().decode(encodedStr.getBytes()), "UTF-8"); ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); String result = (String) engine.eval("unescape('" + java.net.URLDecoder.decode(decodeStr, "UTF-8") + "')"); return result; } }