Here you can find the source of unescapeHTML(String s)
public static String unescapeHTML(String s)
//package com.java2s; /*//w ww .j av a 2s . com * HtmlUtil.java * * This file is part of SQL Workbench/J, http://www.sql-workbench.net * * Copyright 2002-2017, Thomas Kellerer * * Licensed under a modified Apache License, Version 2.0 * that restricts the use for certain governments. * You may not use this file except in compliance with the License. * You may obtain a copy of the License at. * * http://sql-workbench.net/manual/license.html * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * To contact the author please send an email to: support@sql-workbench.net * */ public class Main { public static String unescapeHTML(String s) { String[][] escape = { { "<", "<" }, { ">", ">" }, { "&", "&" }, { """, "\"" }, { "à", "\u00e0" }, { "À", "\u00c0" }, { "â", "\u00e2" }, { "ä", "\u00e4" }, { "Ä", "\u00c4" }, { "Â", "\u00c2" }, { "å", "\u00e5" }, { "Å", "\u00c5" }, { "æ", "\u00e6" }, { "Æ", "\u00c6" }, { "ç", "\u00e7" }, { "Ç", "\u00c7" }, { "é", "\u00e9" }, { "É", "\u00c9" }, { "è", "\u00e8" }, { "È", "\u00c8" }, { "ê", "\u00ea" }, { "Ê", "\u00ca" }, { "ë", "\u00eb" }, { "Ë", "\u00cb" }, { "ï", "\u00ef" }, { "Ï", "\u00cf" }, { "ô", "\u00f4" }, { "Ô", "\u00d4" }, { "ö", "\u00f6" }, { "Ö", "\u00d6" }, { "ø", "\u00f8" }, { "Ø", "\u00d8" }, { "ß", "\u00df" }, { "ù", "\u00f9" }, { "Ù", "\u00d9" }, { "û", "\u00fb" }, { "Û", "\u00db" }, { "ü", "\u00fc" }, { "Ü", "\u00dc" }, { " ", " " }, { "®", "\u00a9" }, { "©", "\u00ae" }, { "€", "\u20a0" } }; int i, j, k; i = s.indexOf('&'); if (i > -1) { j = s.indexOf(';'); if (j > i) { String temp = s.substring(i, j + 1); // search in escape[][] if temp is there k = 0; while (k < escape.length) { if (escape[k][0].equals(temp)) break; else k++; } s = s.substring(0, i) + escape[k][1] + s.substring(j + 1); return unescapeHTML(s); // recursive call } } return s; } }