[oracle@oadb ~]$ echo $LANG
en_US.UTF-8
[oracle@oadb ~]$ cat k1.pl
use Encode;
my $a="测试环境";
print "1111111$a is $a
";
$a=encode_utf8($a);
print "22222222$a is $a
";
$a=decode_utf8($a);
print "333333333$a is $a
";
[oracle@oadb ~]$ perl k1.pl
1111111$a is 测试环境
22222222$a is ???è????????
333333333$a is 测试环境
/****************************
[oracle@oadb ~]$ cat k2.pl
use Encode;
use utf8;
my $a="测试环境";
print "1111111$a is $a
";
# $a=encode_utf8($a);
#print "22222222$a is $a
";
# $a=decode_utf8($a);
#print "333333333$a is $a
";
[oracle@oadb ~]$ perl k2.pl
Wide character in print at k2.pl line 5.
1111111$a is 测试环境
[oracle@oadb ~]$ cat k2.pl
use Encode;
use utf8;
my $a="测试环境";
$a=encode_utf8($a);
print "22222222$a is $a
";
# $a=decode_utf8($a);
#print "333333333$a is $a
";
[oracle@oadb ~]$ perl k2.pl
22222222$a is 测试环境
[oracle@oadb ~]$