Safe encode path names in renamer

fix #3425