dear monks,
use Encode qw(encode);
use Win32::Codepage;
my $w32encoding = Win32::Codepage::get_encoding(); # e.g. "cp936"
my $encoding = $w32encoding ? Encode::resolve_alias($w32encoding)
+: '';
print $encoding ? encode($string, $encoding) : $string;
the out put is :: Unknown encoding ''
it means cp936 is not present ,but ,if i used in the other program decoding with cp936 is working fine
why this is happening ? can you explain that one.
the program where i used cp936 is given below
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;