import java.nio.charset.Charset;
public class EntitiesTest {
@Test public void escape() {
String text = "Hello &<> Å å π 新 there ¾ © »";
String escapedAscii = Entities.escape(text, new OutputSettings().charset("ascii").escapeMode(base));
String escapedAsciiFull = Entities.escape(text, new OutputSettings().charset("ascii").escapeMode(extended));
String escapedAsciiXhtml = Entities.escape(text, new OutputSettings().charset("ascii").escapeMode(xhtml));
String escapedUtfFull = Entities.escape(text, new OutputSettings().charset("UTF-8").escapeMode(base));
String escapedUtfMin = Entities.escape(text, new OutputSettings().charset("UTF-8").escapeMode(xhtml));
assertEquals("Hello &<> Å å π 新 there ¾ © »", escapedAscii);
assertEquals("Hello &<> Å å π 新 there ¾ © »", escapedAsciiFull);
assertEquals("Hello &<> Å å π 新 there ¾ © »", escapedAsciiXhtml);
assertEquals("Hello &<> Å å π 新 there ¾ © »", escapedUtfFull);