check text encoding