encode user entered filepath on non-utf8 environments