convert filepath to unicode using file system encoding

Fixes #871 and #881