commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Closed: (LANG-498) Add StringEscapeUtils.escapeText() methods
Date Tue, 30 Jun 2009 07:08:47 GMT


Henri Yandell closed LANG-498.

    Resolution: Fixed

UnicodeEscaper.outsideOf(32, 0x7f) now works and would handle this case. Or if you want >=
7f, use 0x7e. 

There is also a EscapeUtils.ESCAPE_JAVA_CTRL_CHARS and matching unescape. So your request
is (currently anyway in trunk):

new AggregateTranslator(
            UnicodeEscaper.outsideOf(32, 0x7f)


EscapeUtils.ESCAPE_JAVA_CTRL_CHARS.with( UnicodeEscaper.outsideOf(32, 0x7f) )

I'm resolving this issue as I think this sufficiently simplifies your desire to share the
escapeJava code.

> Add StringEscapeUtils.escapeText() methods
> ------------------------------------------
>                 Key: LANG-498
>                 URL:
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Henning Schmiedehausen
>             Fix For: 3.0
>         Attachments: LANG-498.patch
> I needed to escape text to be print out to a file; mainly so that all non-ASCII characters
(< 32 and >=127) are printed out as escapes (if available) or unicode escapes. This
is a one-way conversion, there is no way to find out whether a String contained "\\n" or a
newline before conversion, so I just set up escapeText() methods, no unescapeText(). 
> Please apply to the next release of commons-lang. :-) 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message