add codec setting when reading text file