Fxed encoding error when uploading files with non-ascii characters.