Detect charsets of the file