Fixed chardetect for non-ascii file names