encode replacements before putting in path

* fixing bug from @noprompt writing bad tests :-)
Merge pull request #15 from joelash/master

Encode replacements before putting in path