use Encode qw(encode); ... #my $thearesp = $theresponse->content; my $thearesp = encode("iso-8859-1", decode("UCS-2LE", $theresponse->content)); #### open FILETEMP, "+>" . "$tempIndex.htm" #### open FILETEMP, "+>" , "$tempIndex.htm"