国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > 服务器 > How to show Chinese character by using Perl?

How to show Chinese character by using Perl?

来源:程序员人生   发布时间:2015-03-02 08:00:22 阅读次数:2656次

You need to usemodule:  Unicode::Map

 

Where to get it?

-http://search.cpan.org/~mschwartz/Unicode-Map-0.112/Map.pm

Download Unicode-Map-0.112.tar.gz

 

How to install it?

-unzip the file andgo the folder:

C:Users ebeccaDesktopTempUnicode-Map-0.112>perlMakefile.PL

Checking if your kit is complete...

Looks good

Generating a dmake-style Makefile

Writing Makefile for Unicode::Map

Writing MYMETA.yml and MYMETA.json

 

-install

C:Users ebeccaDesktopTempUnicode-Map-0.112>dmakeinstall

cp Map/APPLE/DINGBATS.mapbliblibUnicodeMapAPPLEDINGBATS.map

cp Map/APPLE/CROATIAN.mapbliblibUnicodeMapAPPLECROATIAN.map

cp Map/ADOBE/ZDINGBAT.mapbliblibUnicodeMapADOBEDINGBAT.map

cp Map/APPLE/GREEK.map bliblibUnicodeMapAPPLEGREEK.map

cp Map/APPLE/CENTEURO.mapbliblibUnicodeMapAPPLECENTEURO.map

cp Map/APPLE/DEVANAGA.mapbliblibUnicodeMapAPPLEDEVANAGA.map

cp Map/ADOBE/SYMBOL.mapbliblibUnicodeMapADOBESYMBOL.map

cp Map/APPLE/ICELAND.mapbliblibUnicodeMapAPPLEICELAND.map

cp Map/APPLE/GUJARATI.mapbliblibUnicodeMapAPPLEGUJARATI.map

cp Map/APPLE/ARABIC.mapbliblibUnicodeMapAPPLEARABIC.map

cp Map/APPLE/KOREAN.mapbliblibUnicodeMapAPPLEKOREAN.map

cp Map/APPLE/CYRILLIC.mapbliblibUnicodeMapAPPLECYRILLIC.map

cp Map/APPLE/CHINSIMP.mapbliblibUnicodeMapAPPLECHINSIMP.map

cp Map/APPLE/HEBREW.mapbliblibUnicodeMapAPPLEHEBREW.map

cp Map/APPLE/CHINTRAD.mapbliblibUnicodeMapAPPLECHINTRAD.map

cp Map/APPLE/JAPANESE.mapbliblibUnicodeMapAPPLEJAPANESE.map

cp Map/APPLE/GURMUKHI.mapbliblibUnicodeMapAPPLEGURMUKHI.map

cp Map.pm bliblibUnicodeMap.pm

cp Map/ADOBE/STDENC.map bliblibUnicodeMapADOBESTDENC.map

cp Map/EASTASIA/GB2312⑻0.mapbliblibUnicodeMapEASTASIAGB2312⑻0.map

cp Map/EASTASIA/JOHAB.mapbliblibUnicodeMapEASTASIAJOHAB.map

cp Map/EASTASIA/GB2312.mapbliblibUnicodeMapEASTASIAGB2312.map

cp Map/EASTASIA/BIG5.mapbliblibUnicodeMapEASTASIABIG5.map

cp Map/EASTASIA/EUC-KR.mapbliblibUnicodeMapEASTASIAEUC-KR.map

cp Map/APPLE/ROMAN.map bliblibUnicodeMapAPPLEROMAN.map

cp Map/EASTASIA/JIS-X-0208.mapbliblibUnicodeMapEASTASIAJIS-X-0208.map

cp Map/EASTASIA/EUC-JP.mapbliblibUnicodeMapEASTASIAEUC-JP.map

cp Map/EASTASIA/CNS⑴1643⑴986.mapbliblibUnicodeMapEASTASIACNS⑴1643⑴986.map

cp Map/EASTASIA/JIS-X-0201.mapbliblibUnicodeMapEASTASIAJIS-X-0201.map

cp Map/APPLE/SYMBOL.map bliblibUnicodeMapAPPLESYMBOL.map

cp Map/APPLE/THAI.map bliblibUnicodeMapAPPLETHAI.map

cp Map/EASTASIA/KSC1001.mapbliblibUnicodeMapEASTASIAKSC1001.map

cp Map/APPLE/ROMANIAN.mapbliblibUnicodeMapAPPLEROMANIAN.map

cp Map/EASTASIA/JIS-X-0212.mapbliblibUnicodeMapEASTASIAJIS-X-0212.map

cp Map/APPLE/TURKISH.mapbliblibUnicodeMapAPPLETURKISH.map

cp Map/EASTASIA/GB12345⑻0.mapbliblibUnicodeMapEASTASIAGB12345⑻0.map

cp Map/MS/DOS/CP737.map bliblibUnicodeMapMSDOSCP737.map

cp Map/ISO/8859⑹.map bliblibUnicodeMapISO8859⑹.map

cp Map/ISO/8859⑵.map bliblibUnicodeMapISO8859⑵.map

cp Map/ISO/8859⑴5.map bliblibUnicodeMapISO8859⑴5.map

cp Map/ISO/8859⑴0.map bliblibUnicodeMapISO8859⑴0.map

cp Map/EASTASIA/SHIFTJIS.mapbliblibUnicodeMapEASTASIASHIFTJIS.map

cp Map/ISO/8859⑷.map bliblibUnicodeMapISO8859⑷.map

cp Map/ISO/8859⑼.map bliblibUnicodeMapISO8859⑼.map

cp Map/ISO/8859⑴4.map bliblibUnicodeMapISO8859⑴4.map

cp Map/ISO/8859⑴3.map bliblibUnicodeMapISO8859⑴3.map

cp Map/IBM/IBM038.map bliblibUnicodeMapIBMIBM038.map

cp Map/MS/DOS/CP775.mapbliblibUnicodeMapMSDOSCP775.map

cp Map/MS/DOS/CP437.mapbliblibUnicodeMapMSDOSCP437.map

cp Map/EASTASIA/KSC5601⑴992.mapbliblibUnicodeMapEASTASIAKSC5601⑴992.map

cp Map/ISO/8859⑺.map bliblibUnicodeMapISO8859⑺.map

cp Map/ISO/8859⑸.map bliblibUnicodeMapISO8859⑸.map

cp Map/ISO/8859⑻.map bliblibUnicodeMapISO8859⑻.map

cp Map/ISO/8859⑴.map bliblibUnicodeMapISO8859⑴.map

cp Map/ISO/8859⑶.map bliblibUnicodeMapISO8859⑶.map

cp Map/ISO/ISO646-US.mapbliblibUnicodeMapISOISO646-US.map

cp Map/MS/DOS/CP861.mapbliblibUnicodeMapMSDOSCP861.map

cp Map/MS/MAC/GREEK.map bliblibUnicodeMapMSMACGREEK.map

cp Map/MS/MAC/CYRILLIC.mapbliblibUnicodeMapMSMACCYRILLIC.map

cp Map/MS/EBCDIC/CP500.mapbliblibUnicodeMapMSEBCDICCP500.map

cp Map/MS/DOS/CP874.mapbliblibUnicodeMapMSDOSCP874.map

cp Map/MS/EBCDIC/CP037.mapbliblibUnicodeMapMSEBCDICCP037.map

cp Map/MS/DOS/CP869.mapbliblibUnicodeMapMSDOSCP869.map

cp Map/MS/DOS/CP852.mapbliblibUnicodeMapMSDOSCP852.map

cp Map/MS/DOS/CP866.mapbliblibUnicodeMapMSDOSCP866.map

cp Map/MS/EBCDIC/CP875.mapbliblibUnicodeMapMSEBCDICCP875.map

cp Map/MS/DOS/CP862.mapbliblibUnicodeMapMSDOSCP862.map

cp Map/MS/DOS/CP850.mapbliblibUnicodeMapMSDOSCP850.map

cp Map/MS/DOS/CP865.mapbliblibUnicodeMapMSDOSCP865.map

cp Map/MS/DOS/CP857.mapbliblibUnicodeMapMSDOSCP857.map

cp Map/MS/DOS/CP860.mapbliblibUnicodeMapMSDOSCP860.map

cp Map/MS/EBCDIC/CP1026.mapbliblibUnicodeMapMSEBCDICCP1026.map

cp Map/MS/DOS/CP863.mapbliblibUnicodeMapMSDOSCP863.map

cp Map/MS/DOS/CP864.mapbliblibUnicodeMapMSDOSCP864.map

cp Map/MS/DOS/CP855.mapbliblibUnicodeMapMSDOSCP855.map

cp Map/MS/WIN/CP1254.mapbliblibUnicodeMapMSWINCP1254.map

cp Map/MS/WIN/CP949.mapbliblibUnicodeMapMSWINCP949.map

cp Map/MS/WIN/CP1251.mapbliblibUnicodeMapMSWINCP1251.map

cp Map/MS/WIN/CP1253.mapbliblibUnicodeMapMSWINCP1253.map

cp Map/MS/WIN/CP1258.mapbliblibUnicodeMapMSWINCP1258.map

cp Map/MS/WIN/CP1252.mapbliblibUnicodeMapMSWINCP1252.map

cp Map/MS/MAC/ICELAND.mapbliblibUnicodeMapMSMACICELAND.map

cp Map/MS/MAC/ROMAN.mapbliblibUnicodeMapMSMACROMAN.map

cp Map/MS/WIN/CP950.mapbliblibUnicodeMapMSWINCP950.map

cp Map/MS/WIN/CP1256.mapbliblibUnicodeMapMSWINCP1256.map

cp Map/MS/WIN/CP1257.mapbliblibUnicodeMapMSWINCP1257.map

cp Map/MS/MAC/LATIN2.mapbliblibUnicodeMapMSMACLATIN2.map

cp Map/MS/WIN/CP1255.mapbliblibUnicodeMapMSWINCP1255.map

cp Map/NEXT/NEXTSTEP.mapbliblibUnicodeMapNEXTNEXTSTEP.map

cp Map/MS/MAC/TURKISH.mapbliblibUnicodeMapMSMACTURKISH.map

cp Map/MS/WIN/CP936.mapbliblibUnicodeMapMSWINCP936.map

cp Map/REGISTRY bliblibUnicodeMapREGISTRY

cp Map/MS/WIN/CP932.mapbliblibUnicodeMapMSWINCP932.map

cp Map/MS/WIN/CP1250.mapbliblibUnicodeMapMSWINCP1250.map

Running Mkbootstrap for Unicode::Map ()

C:Perl64inperl.exe -MExtUtils::Command -e chmod -- 644Map.bs

C:Perl64inperl.exe C:Perl64libExtUtilsxsubpp  -typemap C:Perl64libExtUtils ypemap  Map.xs

gcc -c          -s -O2-DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPE

C:Perl64inperl.exe -MExtUtils::Mksymlists

     -e"Mksymlists('NAME'=>"Unicode::Map", 'DLBASE' => 'Map','DL_FUNCS' => {  }, 'FUNCLIST' =>[],

dlltool --def Map.def --output-exp dll.exp

g++ -o blibarchautoUnicodeMapMap.dll -Wl,--base-file-Wl,dll.base -mdll -s -static-libgcc -static

dlltool --def Map.def --base-file dll.base --output-expdll.exp

g++ -o blibarchautoUnicodeMapMap.dll -mdll -s-static-libgcc -static-libstdc++ -L"C:Perl64libC

C:Perl64inperl.exe -MExtUtils::Command -e chmod -- 755blibarchautoUnicodeMapMap.dll

C:Perl64inperl.exe -MExtUtils::Command -e cp --tools/mirrorMappings blibscriptmirrorMappings

pl2bat.bat blibscriptmirrorMappings

C:Perl64inperl.exe -MExtUtils::Command -e cp --tools/mkCSGB2312 blibscriptmkCSGB2312

pl2bat.bat blibscriptmkCSGB2312

C:Perl64inperl.exe -MExtUtils::Command -e cp --tools/mkmapfile blibscriptmkmapfile

pl2bat.bat blibscriptmkmapfile

C:Perl64inperl.exe -MExtUtils::Command -e cp --tools/map blibscriptmap

pl2bat.bat blibscriptmap

Files found in blibarch: installing files in bliblib intoarchitecture dependent library tree

Installing C:Perl64sitelibautoUnicodeMapMap.dll

Installing C:Perl64htmlinmap.html

Installing C:Perl64htmlinmkmapfile.html

Installing C:Perl64htmlsitelibUnicodeMap.html

Installing C:Perl64sitelibUnicodeMap.pm

Installing C:Perl64sitelibUnicodeMapREGISTRY

Installing C:Perl64sitelibUnicodeMapADOBESTDENC.map

Installing C:Perl64sitelibUnicodeMapADOBESYMBOL.map

Installing C:Perl64sitelibUnicodeMapADOBEDINGBAT.map

Installing C:Perl64sitelibUnicodeMapAPPLEARABIC.map

Installing C:Perl64sitelibUnicodeMapAPPLECENTEURO.map

Installing C:Perl64sitelibUnicodeMapAPPLECHINSIMP.map

Installing C:Perl64sitelibUnicodeMapAPPLECHINTRAD.map

Installing C:Perl64sitelibUnicodeMapAPPLECROATIAN.map

Installing C:Perl64sitelibUnicodeMapAPPLECYRILLIC.map

Installing C:Perl64sitelibUnicodeMapAPPLEDEVANAGA.map

Installing C:Perl64sitelibUnicodeMapAPPLEDINGBATS.map

Installing C:Perl64sitelibUnicodeMapAPPLEGREEK.map

Installing C:Perl64sitelibUnicodeMapAPPLEGUJARATI.map

Installing C:Perl64sitelibUnicodeMapAPPLEGURMUKHI.map

Installing C:Perl64sitelibUnicodeMapAPPLEHEBREW.map

Installing C:Perl64sitelibUnicodeMapAPPLEICELAND.map

Installing C:Perl64sitelibUnicodeMapAPPLEJAPANESE.map

Installing C:Perl64sitelibUnicodeMapAPPLEKOREAN.map

Installing C:Perl64sitelibUnicodeMapAPPLEROMAN.map

Installing C:Perl64sitelibUnicodeMapAPPLEROMANIAN.map

Installing C:Perl64sitelibUnicodeMapAPPLESYMBOL.map

Installing C:Perl64sitelibUnicodeMapAPPLETHAI.map

Installing C:Perl64sitelibUnicodeMapAPPLETURKISH.map

Installing C:Perl64sitelibUnicodeMapEASTASIABIG5.map

Installing C:Perl64sitelibUnicodeMapEASTASIACNS⑴1643⑴986.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAEUC-JP.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAEUC-KR.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAGB12345⑻0.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAGB2312⑻0.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAGB2312.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAJIS-X-0201.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAJIS-X-0208.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAJIS-X-0212.map

Installing C:Perl64sitelibUnicodeMapEASTASIAJOHAB.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAKSC1001.map

InstallingC:Perl64sitelibUnicodeMapEASTASIAKSC5601⑴992.map

InstallingC:Perl64sitelibUnicodeMapEASTASIASHIFTJIS.map

Installing C:Perl64sitelibUnicodeMapIBMIBM038.map

Installing C:Perl64sitelibUnicodeMapISO8859⑴.map

Installing C:Perl64sitelibUnicodeMapISO8859⑴0.map

Installing C:Perl64sitelibUnicodeMapISO8859⑴3.map

Installing C:Perl64sitelibUnicodeMapISO8859⑴4.map

Installing C:Perl64sitelibUnicodeMapISO8859⑴5.map

Installing C:Perl64sitelibUnicodeMapISO8859⑵.map

Installing C:Perl64sitelibUnicodeMapISO8859⑶.map

Installing C:Perl64sitelibUnicodeMapISO8859⑷.map

Installing C:Perl64sitelibUnicodeMapISO8859⑸.map

Installing C:Perl64sitelibUnicodeMapISO8859⑹.map

Installing C:Perl64sitelibUnicodeMapISO8859⑺.map

Installing C:Perl64sitelibUnicodeMapISO8859⑻.map

Installing C:Perl64sitelibUnicodeMapISO8859⑼.map

Installing C:Perl64sitelibUnicodeMapISOISO646-US.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP437.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP737.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP775.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP850.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP852.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP855.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP857.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP860.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP861.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP862.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP863.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP864.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP865.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP866.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP869.map

Installing C:Perl64sitelibUnicodeMapMSDOSCP874.map

InstallingC:Perl64sitelibUnicodeMapMSEBCDICCP037.map

Installing C:Perl64sitelibUnicodeMapMSEBCDICCP1026.map

InstallingC:Perl64sitelibUnicodeMapMSEBCDICCP500.map

InstallingC:Perl64sitelibUnicodeMapMSEBCDICCP875.map

InstallingC:Perl64sitelibUnicodeMapMSMACCYRILLIC.map

Installing C:Perl64sitelibUnicodeMapMSMACGREEK.map

Installing C:Perl64sitelibUnicodeMapMSMACICELAND.map

Installing C:Perl64sitelibUnicodeMapMSMACLATIN2.map

Installing C:Perl64sitelibUnicodeMapMSMACROMAN.map

Installing C:Perl64sitelibUnicodeMapMSMACTURKISH.map

Installing C:Perl64sitelibUnicodeMapMSWINCP1250.map

Installing C:Perl64sitelibUnicodeMapMSWINCP1251.map

Installing C:Perl64sitelibUnicodeMapMSWINCP1252.map

Installing C:Perl64sitelibUnicodeMapMSWINCP1253.map

Installing C:Perl64sitelibUnicodeMapMSWINCP1254.map

Installing C:Perl64sitelibUnicodeMapMSWINCP1255.map

Installing C:Perl64sitelibUnicodeMapMSWINCP1256.map

Installing C:Perl64sitelibUnicodeMapMSWINCP1257.map

Installing C:Perl64sitelibUnicodeMapMSWINCP1258.map

Installing C:Perl64sitelibUnicodeMapMSWINCP932.map

Installing C:Perl64sitelibUnicodeMapMSWINCP936.map

Installing C:Perl64sitelibUnicodeMapMSWINCP949.map

Installing C:Perl64sitelibUnicodeMapMSWINCP950.map

Installing C:Perl64sitelibUnicodeMapNEXTNEXTSTEP.map

Installing C:Perl64siteinmap

Installing C:Perl64siteinmap.bat

Installing C:Perl64siteinmirrorMappings

Installing C:Perl64siteinmirrorMappings.bat

Installing C:Perl64siteinmkCSGB2312

Installing C:Perl64siteinmkCSGB2312.bat

Installing C:Perl64siteinmkmapfile

Installing C:Perl64siteinmkmapfile.bat

Appending installation info to C:Perl64lib/perllocal.pod

dmake:  Warning: --Target [install] was made but the time stamp has not been updated.

 

Testing script:

#! /usr/bin/perl

use strict;

use Unicode::Map;

 

my $Map = new Unicode::Map("GB2312");

my $utf16 = $Map->to_unicode("这是瑞贝卡");

my $locale = $Map->from_unicode($utf16);

print "$locale";

 

Execution result:

C:RebeccascriptperlUnicode>perl unicode_test_v1.pl

这是瑞贝卡

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生