open( HTML, "<:encoding(cp1252)", $filename ); # now text will be converted from cp1252 to utf8 # as it is read from the file.