This reverts commit 28f3922. Keep the path encoding settled in #2082 (#2170) and #2608 until a concrete report needs more: user input belongs in encode_path_component(), and an embedded NUL is invalid input.
28f3922