correctly encode path delimiters