use Encode; use Win32::Codepage; use strict; use diagnostics; my $encoding= Win32::Codepage::get_encoding(); my $str8=decode($encoding,"中国的网页");#$encoding has the value cp936; open OUT,">:utf8","D:\\output1.doc" or print "could not open"; print "\nIs ".encode("$encoding",$str8)." utf8 format : ",utf8::is_utf8($str8),"\n\n"; print OUT $str8."\n"; close OUT;