Perl如何Print中文&Perl解决genesis程序输出中文目录
发布时间:2017-01-12 11:17:00 点击:
Perl如何Print中文&Perl解决genesis程序输出中文目录
Perl直接输出中文需要调用模块:use Encode qw/from_to/;
以下是程序代码:
#!c:/perl/bin/perl -w
#################################################
#scripts:test by chris
#author: chris
#date:2015.08.18
#purpose:
#################################################
use strict;
use warnings;
use Encode qw/from_to/;
#print english.
print "hello_worl \n";
#print chinese.
my $print_result = "工程部";
from_to($print_result, "utf8", "gbk");
print "$print_result \n";