Если Вы готовы использовать C, можно использовать функция strtok. Необходимо обратить внимание на проблемы многопоточности при использовании его.
Удобно иметь читаемые URL-адреса.
Например, эта страница могла бы иметь было:
http://stackoverflow.com/questions/1093611/why%20shouldnt%20i%20use%20spaces%20in%20file%20names%20when%20i%20can%20use%20a%20code%20equivalent
На первый взгляд не так читабельно.
Другая проблема, как упоминалось в «Руководстве по безопасности браузера» , некоторые браузеры декодируют такие % 20 в пробелы, а некоторые - нет. Это приводит к тому, что одна и та же ссылка выглядит по-разному в разных браузерах.
Вы можете просто создать страницу загрузки для своих пользователей со списком всех файлов. Если вы принудительно загрузите ссылку, пользователю никогда не придется вводить% 20
first off, it is not that you can't it is that you shouldn't. It is not best practice to have spaces in your file names, it just complicates things, period.
second, it is harder for someone to manually type in the address if they wish.
i.e. "hey go to my site and get my resume at" www.... /my%20resume
just my $0.02
It's ugly. Aesthetics do matter for anything a user sees.
They are not very human readable (memorable or typeable) if they show up in URLs and if they are not properly escaped you can have line breaks in things like email.
What's your reason for using them (instead of PascalCase or Blog-Permalink-style) in the first place?
I like to make things as simple as possible for user usability and developer code readability. One way to do that is to not use spaces like that.
Use something that's more human readable, such as file-name.html or fileName.html. This will be more human readable and easier to work with.