commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-519) Define standard for escape/unescape Java
Date Sun, 19 Jul 2009 19:01:14 GMT

    [ https://issues.apache.org/jira/browse/LANG-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12733038#action_12733038
] 

Henri Yandell commented on LANG-519:
------------------------------------

Escape currently defined as:

    public static final CharSequenceTranslator ESCAPE_JAVA =
          new LookupTranslator(
            new String[][] {
              {"\"", "\\\""},
              {"\\", "\\\\"},
          }).with(
            new LookupTranslator(EntityArrays.JAVA_CTRL_CHARS_ESCAPE())
          ).with(
            UnicodeEscaper.outsideOf(32, 0x7f)
        );

Unescape defined as:

    public static final CharSequenceTranslator UNESCAPE_JAVA =
        new AggregateTranslator(
            new UnicodeUnescaper(),
            new LookupTranslator(EntityArrays.JAVA_CTRL_CHARS_UNESCAPE())
            new LookupTranslator(
                      new String[][] { 
                            {"\\\\", "\\"},
                            {"\\\"", "\""},
                            {"\\'", "'"},
                            {"\\", ""}
                      })
        );

CTRL chars are \n, \r, \b, \t and \f.

I think these are fine. Will leave this open for comment and close otherwise.

> Define standard for escape/unescape Java
> ----------------------------------------
>
>                 Key: LANG-519
>                 URL: https://issues.apache.org/jira/browse/LANG-519
>             Project: Commons Lang
>          Issue Type: Sub-task
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>


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


Mime
View raw message