StringEscapeUtils does most of the work, but only up to HTML4. For unreached characters, you can create your own class and add as needed. Here is an example class
public class HTMLDecoder { public static String decodeHTML(String html) { String out = StringEscapeUtils.unescapeHtml4(html); out = out.replaceAll("รยฎ", "ยฎ"); out = out.replaceAll("รข\u0084ยข", "โข"); return out; } }
Add to build.bradle
compile 'org.apache.commons:commons-lang3:3.0'
source share