fix the listing of subdirs that have spaces by encoding URI only once
use encodeURIcomponent, capture its use in some tests
Merge pull request #1253 from iamdoron/master

in directory, fix the listing of subdirs that reside in a subdirs that have spaces