[ https://issues.apache.org/jira/browse/LANG-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15681036#comment-15681036 ]
ASF GitHub Bot commented on LANG-1066: -------------------------------------- Github user PascalSchumacher commented on a diff in the pull request: https://github.com/apache/commons-lang/pull/208#discussion_r88799453 --- 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 -- according to http://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html it does not have to be escaped > 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)