Java编码和解码库:unbescape

jopen 6年前

unbescape是一个Java类库,提供了功能强和卓越性能来执行编码和解码(escape 和 unescape)操作。支持:

  • HTML (HTML5 and HTML 4)
  • XML (XML 1.0 and XML 1.1)
  • JavaScript
  • JSON
  • URI / URL (both paths and query parameters)
  • CSS (both identifiers and string literals)
  • CSV (Comma-Separated Values)
  • Java literals
  • Java .properties files (both keys and values)

它的目标:

  • 为便于使用。只需要几行代码。没有额外的依赖关系。
  • To be fast. Faster and lighter than most other options available in Java.
  • To be versatile. Provides different escaping types and levels in order to better adapt to different scenarios and contexts.
  • To be feature-complete. Includes full HTML5 support, careful implementation of the JavaScript, JSON, Java, etc specifications, advanced format tweaks...

    final String unescapedText = HtmlEscape.unescapeHtml(escapedText);

项目主页:http://www.open-open.com/lib/view/home/1406776851155