You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2010/03/27 09:26:27 UTC
[jira] Closed: (LANG-612) Add ability to do only basic escape &
unescape to StringEscapeUtils
[ https://issues.apache.org/jira/browse/LANG-612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell closed LANG-612.
------------------------------
Resolution: Duplicate
Fix Version/s: 3.0
In Lang 3.0 this is the default behaviour - namely that escapeXml only escapes " < > and &.
To get the old behaviour you would do:
StringEscapeUtils.XML_ESCAPE.with(UnicodeEscaper.above(0x7f)).escape(...)
Opinions on the API much appreciated :)
StringEscapeUtils is now a helper class to an underlying text.translate package. Static helper translators are available (as used above), along with the old (String) methods. The (Writer) methods are gone, instead you can call a (Writer) API directly on the underlying translator objects.
* http://commons.apache.org/lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html
* http://commons.apache.org/lang/apidocs/org/apache/commons/lang3/text/translate/package-summary.html
> Add ability to do only basic escape & unescape to StringEscapeUtils
> --------------------------------------------------------------------
>
> Key: LANG-612
> URL: https://issues.apache.org/jira/browse/LANG-612
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 2.4
> Reporter: Keegan Witt
> Priority: Minor
> Fix For: 3.0
>
>
> I thought it'd be nice to have another method to do only the basic escapes (double-quote, ampersand, less-than, and greater-than) so one can escape/unescape xml or html while leaving the unicode escapes (or lack thereof) intact. This could also be done as a boolean passed to the existing xml and html methods that would indicate whether or not the unicode should also be escaped/unescaped.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.