有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Ascii未在commons lang3中转换

StringEscapeUtils.escapeXml("Cortés")正在commons-lang2中工作。3但在3.2.1中不起作用。预期输出为"Cortés",但实际输出为"Cortes"


共 (1) 个答案

  1. # 1 楼答案

    escapeXml()在3.2.1中被弃用。用escapeXml10()escapeXml11()代替

    或者,从文档中:

    Note that Unicode characters greater than 0x7f are as of 3.0, no longer escaped. If you still wish this functionality, you can achieve it via the following: StringEscapeUtils.ESCAPE_XML.with( NumericEntityEscaper.between(0x7f, Integer.MAX_VALUE) );