I am developing a Share dashlet that should point the user to some document library spaces in Alfresco. You need to doubly-encode the path:
encodeURIComponent(encodeURIComponent("My local path/With croatian letters/šđćčž"));
Why is this? Because if you only encode once, the spaces and slashes will be encoded – but the extra characters will be encoded with those special characters and the document library filter won’t be able to get it. I assume that this is because the doclib filter will take your given path, then call a remote webscript with it to get the space contents. But if your name has special characters, this doesn’t get decoded well on the way.
Standard disclaimer: this post is only for purposes of me having to write it down and then possibly remember it better next time.