org.apache.commons.lang3.StringEscapeUtils.unescapeHtml3()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(230)

本文整理了Java中org.apache.commons.lang3.StringEscapeUtils.unescapeHtml3()方法的一些代码示例,展示了StringEscapeUtils.unescapeHtml3()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StringEscapeUtils.unescapeHtml3()方法的具体详情如下:
包路径:org.apache.commons.lang3.StringEscapeUtils
类名称:StringEscapeUtils
方法名:unescapeHtml3

StringEscapeUtils.unescapeHtml3介绍

[英]Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. Supports only HTML 3.0 entities.
[中]unescape将包含实体转义的字符串转换为包含与转义相对应的实际Unicode字符的字符串。仅支持HTML 3.0实体。

代码示例

代码示例来源:origin: org.apache.commons/commons-lang3

@Test
public void testUnescapeSurrogatePairs() throws Exception {
  assertEquals("\uD83D\uDE30", StringEscapeUtils.unescapeCsv("\uD83D\uDE30"));
  // Examples from https://en.wikipedia.org/wiki/UTF-16
  assertEquals("\uD800\uDC00", StringEscapeUtils.unescapeCsv("\uD800\uDC00"));
  assertEquals("\uD834\uDD1E", StringEscapeUtils.unescapeCsv("\uD834\uDD1E"));
  assertEquals("\uDBFF\uDFFD", StringEscapeUtils.unescapeCsv("\uDBFF\uDFFD"));
  assertEquals("\uDBFF\uDFFD", StringEscapeUtils.unescapeHtml3("\uDBFF\uDFFD"));
  assertEquals("\uDBFF\uDFFD", StringEscapeUtils.unescapeHtml4("\uDBFF\uDFFD"));
}

代码示例来源:origin: org.eclipse.dirigible/dirigible-api-utils

/**
 * Unescape HTML 3.
 *
 * @param input
 *            the input
 * @return the unescaped input
 */
public static final String unescapeHtml3(String input) {
  return StringEscapeUtils.unescapeHtml3(input);
}

代码示例来源:origin: org.eclipse.dirigible/dirigible-api-facade-utils

/**
 * Unescape HTML 3.
 *
 * @param input
 *            the input
 * @return the unescaped input
 */
public static final String unescapeHtml3(String input) {
  return StringEscapeUtils.unescapeHtml3(input);
}

代码示例来源:origin: com.github.monnetproject/clesa

private String cleanText(String s) {
    return StringEscapeUtils.unescapeHtml3(s.replaceAll("\\{\\{[^\\}]*\\}\\}", " ").replaceAll("[='\\[\\]\\|]", " ").replaceAll("^[\\*\\:#]+", " ").replaceAll("<[^>]*>", " "));
  }    
}

代码示例来源:origin: org.xworker/xworker_core

public static String unescapeHtml3(ActionContext actionContext){
  Thing self = actionContext.getObject("self");
  String str  = (String) self.doAction("getStr", actionContext);
  return StringEscapeUtils.unescapeHtml3(str);
}

代码示例来源:origin: sakaiproject/sakai

String title = StringEscapeUtils.unescapeHtml3(publishedAssessment.getTitle());
if(!g.isAssignmentDefined(gradebookUId, title))

相关文章