commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1066) shell/XSI escape/unescape support
Date Sat, 19 Nov 2016 11:37:58 GMT

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

ASF GitHub Bot commented on LANG-1066:
--------------------------------------

Github user britter commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/208#discussion_r88777887
  
    --- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
    @@ -272,6 +272,40 @@ public int translate(final CharSequence input, final int index, final
Writer out
             }
         }
     
    +    /**
    +     * Translator object for escaping Shell command language.
    +     *
    +     * @see <a href="http://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html">Shell
Command Language</a>
    +     */
    +    public static final CharSequenceTranslator ESCAPE_XSI =
    +          new LookupTranslator(
    +            new String[][] {
    +              {"|", "\\|"},
    +              {"&", "\\&"},
    +              {";", "\\;"},
    +              {"<", "\\<"},
    +              {">", "\\>"},
    +              {"(", "\\("},
    +              {")", "\\)"},
    +              {"$", "\\$"},
    +              {"`", "\\`"},
    +              {"\\", "\\\\"},
    +              {"\"", "\\\""},
    +              {"'", "\\'"},
    +              {" ", "\\ "},
    +              {"\t", "\\\t"},
    +              {"\r\n", ""},
    +              {"\n", ""},
    +              {"*", "\\*"},
    +              {"?", "\\?"},
    +              {"[", "\\["},
    --- End diff --
    
    What about the closing braked?


> shell/XSI escape/unescape support
> ---------------------------------
>
>                 Key: LANG-1066
>                 URL: https://issues.apache.org/jira/browse/LANG-1066
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.3.2
>            Reporter: Mark
>            Priority: Minor
>         Attachments: commons-lang3.trunk.rev1639624.patch
>
>
> Please add the supplied patch. Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message