to process filename correctly if it contains non-ascii