commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Resolved] (LANG-918) Extend StringEscapeUtils with escapeFilename() method
Date Sat, 21 Sep 2013 01:08:51 GMT


Sebb resolved LANG-918.

    Resolution: Won't Fix

Not possible in general, see:
> Extend StringEscapeUtils with escapeFilename() method
> -----------------------------------------------------
>                 Key: LANG-918
>                 URL:
>             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:

View raw message