You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2013/09/21 03:08:51 UTC

[jira] [Resolved] (LANG-918) Extend StringEscapeUtils with escapeFilename() method

     [ https://issues.apache.org/jira/browse/LANG-918?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved LANG-918.
-----------------------

    Resolution: Won't Fix

Not possible in general, see: https://issues.apache.org/jira/browse/IO-289
                
> Extend StringEscapeUtils with escapeFilename() method
> -----------------------------------------------------
>
>                 Key: LANG-918
>                 URL: https://issues.apache.org/jira/browse/LANG-918
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*, lang.text.*
>            Reporter: Olivier Vierlinck
>            Priority: Minor
>
> It would be nice if StringEscapeUtils could take any string (include with backslash, forward slash, tab, CR, LF, extended unicode chars,...) and turn it into a valid filename, escaping the 'invalid' characters.
> Implementation might be OS-dependent or simply escape all characters which are invalid in at least one of the major OS (Unix/Windows/Mac)
> Rationale: it is quite common to receive uncontrolled text (from Web form, from mail parsing, ...) and need to turn it into some part of file/folder name (to create some workspace, archive data,...) which 'ressemble' (and +/- human readable) to the original free text.
> Could be very similar to escapeHtml(): replace each invalid char by %HexCodeOfChar - only the list of 'invalid chars' would be different.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira