On Tue, Oct 01, 2002 at 08:10:37AM +0000, Matthew Bevan wrote:
> What characters should I dissalow (translate into spaces or _ characters)?
>
> So far, I've got the following rules set up:
> if ( *p == '/' ) *p = '_';
> if ( *p < ' ' ) *p = '_';
> if ( *p > 165 ) *p = '_';
I don't see any need to convert spaces into '_' - the space character is
completely legitimate in VFS file names.
Technically, here's what's allowed in VFS file names:
- Letters A through Z.
- Digits 0 through 9.
- All characters with ASCII codes greater than 127.
- Space.
- The following characters below 30h: $ % - _ @ ~ ! ( ) { } ^ # &
If you exclude these chars above 165d, files with non-English names (i.e.
Chinese, Japanese, Korean, etc.) will end up being nothing but underscores).
The only stuff you *really* need to keep out is "/ \ : ? *" since
DOS/Windows uses those for path separators and wildcards.
--
Dave Kessler
President - Kopsis, Inc.
http://kopsisengineering.com
|