The safest bet is to refer to the wikipedia entry for the allowed character set for any operating system. It can be found from here.
For instance, for most unix based systems, the allowed character set is 8 bit set and reserved character is the null character (NUL, '\0'
). However, it is not a good practice to use the special characters in the file names as they pose a problem while removing them.
For example, I can have a file name as -ramesh.txt
and I try to remove it as below.
rm -ramesh.txt
rm: invalid option -- 'a'
Try `rm ./-ramesh.txt' to remove the file `-ramesh.txt'.
Try `rm --help' for more information.
rm "-ramesh.txt"
rm: invalid option -- 'a'
Try `rm ./-ramesh.txt' to remove the file `-ramesh.txt'.
Try `rm --help' for more information.
I need to delete the file as,
rm -- "-ramesh.txt"
rm: remove regular empty file `-ramesh.txt'? y
More details can be found from this answer as well.
In Linux and OS-X only /
of the printable ASCII set is prohibited I
believe. Some characters (shell metacharacters like *?!
) will cause
problems in command lines and will require the filename to be
appropriately quoted or escaped.
Linux filesystems such as ext2, ext3 are character-set agnostic (I
think they just treat it more or less as a byte stream - only nulls
and /
are prohibited). This means you can store filenames in UTF-8
encoding. I believe it is up to the shell or other application to know
what encoding to use to properly convert the filename for display or
processing.
So to conclude, the problem is not in using the special characters for file names but on how to handle them.