tulskiy / musique

Java audio player. Supports mp3, ogg, flac, wavpack, ape, wav, au, aiff. Builtin support for cue files, gapless playback, SHOUTCast/IceCast Radio, last.fm scrobbling.
http://tulskiy.github.com/musique/
GNU Lesser General Public License v3.0
131 stars 44 forks source link

File Operations does not respect special characters #35

Closed bassstorm closed 13 years ago

bassstorm commented 13 years ago

Special characters should be handled accurately. For example, if "/" character is presented in track title, then extra folder will be created at destination during Move files process. Would be nice to respect Win limitations as well (maybe optional).

tulskiy commented 13 years ago

so I guess I need to strip some punctuation from generated file name. What is 100% safe set of punctuation marks that are allowed on all platforms? I'm thinking _+-=.,(){} are safe, rest should either be removed or replaced with some other character. Am I missing any?

bassstorm commented 13 years ago

Next ones are allowed by FAT32: ! # $ % & ' ( ) + - @ ^ _ ` { } ~ , . ; = [ ] Pretty sure all other filesystems also have no issues with them :)

I'd personally prefer to replace "illegal" character by underscore char ("_").

PS. Unicode chars like "é" or "â" shouldn't be replaced of course.

tulskiy commented 13 years ago

ok, so it's easier to remove characters that are not allowed - / \ | : * ? < > " and wikipedia says that + [ ] are not allowed on fat32. anything else?

bassstorm commented 13 years ago

Agree, easier to compile list of not allowed chars. According to Wiki: "+ , . ; = [ ] They are allowed in long file names only." Long file names supported by any decent Win version, so it's not a problem. I think final list will be something like: / \ | : * ? < > "