How to show Chinese character by using Perl?

來源:互聯網
上載者:User

標籤:perl

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\rebecca\Desktop\Temp\Unicode-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\rebecca\Desktop\Temp\Unicode-Map-0.112>dmakeinstall

cp Map/APPLE/DINGBATS.mapblib\lib\Unicode\Map\APPLE\DINGBATS.map

cp Map/APPLE/CROATIAN.mapblib\lib\Unicode\Map\APPLE\CROATIAN.map

cp Map/ADOBE/ZDINGBAT.mapblib\lib\Unicode\Map\ADOBE\ZDINGBAT.map

cp Map/APPLE/GREEK.map blib\lib\Unicode\Map\APPLE\GREEK.map

cp Map/APPLE/CENTEURO.mapblib\lib\Unicode\Map\APPLE\CENTEURO.map

cp Map/APPLE/DEVANAGA.mapblib\lib\Unicode\Map\APPLE\DEVANAGA.map

cp Map/ADOBE/SYMBOL.mapblib\lib\Unicode\Map\ADOBE\SYMBOL.map

cp Map/APPLE/ICELAND.mapblib\lib\Unicode\Map\APPLE\ICELAND.map

cp Map/APPLE/GUJARATI.mapblib\lib\Unicode\Map\APPLE\GUJARATI.map

cp Map/APPLE/ARABIC.mapblib\lib\Unicode\Map\APPLE\ARABIC.map

cp Map/APPLE/KOREAN.mapblib\lib\Unicode\Map\APPLE\KOREAN.map

cp Map/APPLE/CYRILLIC.mapblib\lib\Unicode\Map\APPLE\CYRILLIC.map

cp Map/APPLE/CHINSIMP.mapblib\lib\Unicode\Map\APPLE\CHINSIMP.map

cp Map/APPLE/HEBREW.mapblib\lib\Unicode\Map\APPLE\HEBREW.map

cp Map/APPLE/CHINTRAD.mapblib\lib\Unicode\Map\APPLE\CHINTRAD.map

cp Map/APPLE/JAPANESE.mapblib\lib\Unicode\Map\APPLE\JAPANESE.map

cp Map/APPLE/GURMUKHI.mapblib\lib\Unicode\Map\APPLE\GURMUKHI.map

cp Map.pm blib\lib\Unicode\Map.pm

cp Map/ADOBE/STDENC.map blib\lib\Unicode\Map\ADOBE\STDENC.map

cp Map/EASTASIA/GB2312-80.mapblib\lib\Unicode\Map\EASTASIA\GB2312-80.map

cp Map/EASTASIA/JOHAB.mapblib\lib\Unicode\Map\EASTASIA\JOHAB.map

cp Map/EASTASIA/GB2312.mapblib\lib\Unicode\Map\EASTASIA\GB2312.map

cp Map/EASTASIA/BIG5.mapblib\lib\Unicode\Map\EASTASIA\BIG5.map

cp Map/EASTASIA/EUC-KR.mapblib\lib\Unicode\Map\EASTASIA\EUC-KR.map

cp Map/APPLE/ROMAN.map blib\lib\Unicode\Map\APPLE\ROMAN.map

cp Map/EASTASIA/JIS-X-0208.mapblib\lib\Unicode\Map\EASTASIA\JIS-X-0208.map

cp Map/EASTASIA/EUC-JP.mapblib\lib\Unicode\Map\EASTASIA\EUC-JP.map

cp Map/EASTASIA/CNS-11643-1986.mapblib\lib\Unicode\Map\EASTASIA\CNS-11643-1986.map

cp Map/EASTASIA/JIS-X-0201.mapblib\lib\Unicode\Map\EASTASIA\JIS-X-0201.map

cp Map/APPLE/SYMBOL.map blib\lib\Unicode\Map\APPLE\SYMBOL.map

cp Map/APPLE/THAI.map blib\lib\Unicode\Map\APPLE\THAI.map

cp Map/EASTASIA/KSC1001.mapblib\lib\Unicode\Map\EASTASIA\KSC1001.map

cp Map/APPLE/ROMANIAN.mapblib\lib\Unicode\Map\APPLE\ROMANIAN.map

cp Map/EASTASIA/JIS-X-0212.mapblib\lib\Unicode\Map\EASTASIA\JIS-X-0212.map

cp Map/APPLE/TURKISH.mapblib\lib\Unicode\Map\APPLE\TURKISH.map

cp Map/EASTASIA/GB12345-80.mapblib\lib\Unicode\Map\EASTASIA\GB12345-80.map

cp Map/MS/DOS/CP737.map blib\lib\Unicode\Map\MS\DOS\CP737.map

cp Map/ISO/8859-6.map blib\lib\Unicode\Map\ISO\8859-6.map

cp Map/ISO/8859-2.map blib\lib\Unicode\Map\ISO\8859-2.map

cp Map/ISO/8859-15.map blib\lib\Unicode\Map\ISO\8859-15.map

cp Map/ISO/8859-10.map blib\lib\Unicode\Map\ISO\8859-10.map

cp Map/EASTASIA/SHIFTJIS.mapblib\lib\Unicode\Map\EASTASIA\SHIFTJIS.map

cp Map/ISO/8859-4.map blib\lib\Unicode\Map\ISO\8859-4.map

cp Map/ISO/8859-9.map blib\lib\Unicode\Map\ISO\8859-9.map

cp Map/ISO/8859-14.map blib\lib\Unicode\Map\ISO\8859-14.map

cp Map/ISO/8859-13.map blib\lib\Unicode\Map\ISO\8859-13.map

cp Map/IBM/IBM038.map blib\lib\Unicode\Map\IBM\IBM038.map

cp Map/MS/DOS/CP775.mapblib\lib\Unicode\Map\MS\DOS\CP775.map

cp Map/MS/DOS/CP437.mapblib\lib\Unicode\Map\MS\DOS\CP437.map

cp Map/EASTASIA/KSC5601-1992.mapblib\lib\Unicode\Map\EASTASIA\KSC5601-1992.map

cp Map/ISO/8859-7.map blib\lib\Unicode\Map\ISO\8859-7.map

cp Map/ISO/8859-5.map blib\lib\Unicode\Map\ISO\8859-5.map

cp Map/ISO/8859-8.map blib\lib\Unicode\Map\ISO\8859-8.map

cp Map/ISO/8859-1.map blib\lib\Unicode\Map\ISO\8859-1.map

cp Map/ISO/8859-3.map blib\lib\Unicode\Map\ISO\8859-3.map

cp Map/ISO/ISO646-US.mapblib\lib\Unicode\Map\ISO\ISO646-US.map

cp Map/MS/DOS/CP861.mapblib\lib\Unicode\Map\MS\DOS\CP861.map

cp Map/MS/MAC/GREEK.map blib\lib\Unicode\Map\MS\MAC\GREEK.map

cp Map/MS/MAC/CYRILLIC.mapblib\lib\Unicode\Map\MS\MAC\CYRILLIC.map

cp Map/MS/EBCDIC/CP500.mapblib\lib\Unicode\Map\MS\EBCDIC\CP500.map

cp Map/MS/DOS/CP874.mapblib\lib\Unicode\Map\MS\DOS\CP874.map

cp Map/MS/EBCDIC/CP037.mapblib\lib\Unicode\Map\MS\EBCDIC\CP037.map

cp Map/MS/DOS/CP869.mapblib\lib\Unicode\Map\MS\DOS\CP869.map

cp Map/MS/DOS/CP852.mapblib\lib\Unicode\Map\MS\DOS\CP852.map

cp Map/MS/DOS/CP866.mapblib\lib\Unicode\Map\MS\DOS\CP866.map

cp Map/MS/EBCDIC/CP875.mapblib\lib\Unicode\Map\MS\EBCDIC\CP875.map

cp Map/MS/DOS/CP862.mapblib\lib\Unicode\Map\MS\DOS\CP862.map

cp Map/MS/DOS/CP850.mapblib\lib\Unicode\Map\MS\DOS\CP850.map

cp Map/MS/DOS/CP865.mapblib\lib\Unicode\Map\MS\DOS\CP865.map

cp Map/MS/DOS/CP857.mapblib\lib\Unicode\Map\MS\DOS\CP857.map

cp Map/MS/DOS/CP860.mapblib\lib\Unicode\Map\MS\DOS\CP860.map

cp Map/MS/EBCDIC/CP1026.mapblib\lib\Unicode\Map\MS\EBCDIC\CP1026.map

cp Map/MS/DOS/CP863.mapblib\lib\Unicode\Map\MS\DOS\CP863.map

cp Map/MS/DOS/CP864.mapblib\lib\Unicode\Map\MS\DOS\CP864.map

cp Map/MS/DOS/CP855.mapblib\lib\Unicode\Map\MS\DOS\CP855.map

cp Map/MS/WIN/CP1254.mapblib\lib\Unicode\Map\MS\WIN\CP1254.map

cp Map/MS/WIN/CP949.mapblib\lib\Unicode\Map\MS\WIN\CP949.map

cp Map/MS/WIN/CP1251.mapblib\lib\Unicode\Map\MS\WIN\CP1251.map

cp Map/MS/WIN/CP1253.mapblib\lib\Unicode\Map\MS\WIN\CP1253.map

cp Map/MS/WIN/CP1258.mapblib\lib\Unicode\Map\MS\WIN\CP1258.map

cp Map/MS/WIN/CP1252.mapblib\lib\Unicode\Map\MS\WIN\CP1252.map

cp Map/MS/MAC/ICELAND.mapblib\lib\Unicode\Map\MS\MAC\ICELAND.map

cp Map/MS/MAC/ROMAN.mapblib\lib\Unicode\Map\MS\MAC\ROMAN.map

cp Map/MS/WIN/CP950.mapblib\lib\Unicode\Map\MS\WIN\CP950.map

cp Map/MS/WIN/CP1256.mapblib\lib\Unicode\Map\MS\WIN\CP1256.map

cp Map/MS/WIN/CP1257.mapblib\lib\Unicode\Map\MS\WIN\CP1257.map

cp Map/MS/MAC/LATIN2.mapblib\lib\Unicode\Map\MS\MAC\LATIN2.map

cp Map/MS/WIN/CP1255.mapblib\lib\Unicode\Map\MS\WIN\CP1255.map

cp Map/NEXT/NEXTSTEP.mapblib\lib\Unicode\Map\NEXT\NEXTSTEP.map

cp Map/MS/MAC/TURKISH.mapblib\lib\Unicode\Map\MS\MAC\TURKISH.map

cp Map/MS/WIN/CP936.mapblib\lib\Unicode\Map\MS\WIN\CP936.map

cp Map/REGISTRY blib\lib\Unicode\Map\REGISTRY

cp Map/MS/WIN/CP932.mapblib\lib\Unicode\Map\MS\WIN\CP932.map

cp Map/MS/WIN/CP1250.mapblib\lib\Unicode\Map\MS\WIN\CP1250.map

Running Mkbootstrap for Unicode::Map ()

C:\Perl64\bin\perl.exe -MExtUtils::Command -e chmod -- 644Map.bs

C:\Perl64\bin\perl.exe C:\Perl64\lib\ExtUtils\xsubpp  -typemap C:\Perl64\lib\ExtUtils\typemap  Map.xs

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

C:\Perl64\bin\perl.exe -MExtUtils::Mksymlists \

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

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

g++ -o blib\arch\auto\Unicode\Map\Map.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 blib\arch\auto\Unicode\Map\Map.dll -mdll -s-static-libgcc -static-libstdc++ -L"C:\Perl64\lib\C

C:\Perl64\bin\perl.exe -MExtUtils::Command -e chmod -- 755blib\arch\auto\Unicode\Map\Map.dll

C:\Perl64\bin\perl.exe -MExtUtils::Command -e cp --tools/mirrorMappings blib\script\mirrorMappings

pl2bat.bat blib\script\mirrorMappings

C:\Perl64\bin\perl.exe -MExtUtils::Command -e cp --tools/mkCSGB2312 blib\script\mkCSGB2312

pl2bat.bat blib\script\mkCSGB2312

C:\Perl64\bin\perl.exe -MExtUtils::Command -e cp --tools/mkmapfile blib\script\mkmapfile

pl2bat.bat blib\script\mkmapfile

C:\Perl64\bin\perl.exe -MExtUtils::Command -e cp --tools/map blib\script\map

pl2bat.bat blib\script\map

Files found in blib\arch: installing files in blib\lib intoarchitecture dependent library tree

Installing C:\Perl64\site\lib\auto\Unicode\Map\Map.dll

Installing C:\Perl64\html\bin\map.html

Installing C:\Perl64\html\bin\mkmapfile.html

Installing C:\Perl64\html\site\lib\Unicode\Map.html

Installing C:\Perl64\site\lib\Unicode\Map.pm

Installing C:\Perl64\site\lib\Unicode\Map\REGISTRY

Installing C:\Perl64\site\lib\Unicode\Map\ADOBE\STDENC.map

Installing C:\Perl64\site\lib\Unicode\Map\ADOBE\SYMBOL.map

Installing C:\Perl64\site\lib\Unicode\Map\ADOBE\ZDINGBAT.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\ARABIC.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\CENTEURO.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\CHINSIMP.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\CHINTRAD.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\CROATIAN.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\CYRILLIC.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\DEVANAGA.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\DINGBATS.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\GREEK.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\GUJARATI.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\GURMUKHI.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\HEBREW.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\ICELAND.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\JAPANESE.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\KOREAN.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\ROMAN.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\ROMANIAN.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\SYMBOL.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\THAI.map

Installing C:\Perl64\site\lib\Unicode\Map\APPLE\TURKISH.map

Installing C:\Perl64\site\lib\Unicode\Map\EASTASIA\BIG5.map

Installing C:\Perl64\site\lib\Unicode\Map\EASTASIA\CNS-11643-1986.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\EUC-JP.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\EUC-KR.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\GB12345-80.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\GB2312-80.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\GB2312.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\JIS-X-0201.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\JIS-X-0208.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\JIS-X-0212.map

Installing C:\Perl64\site\lib\Unicode\Map\EASTASIA\JOHAB.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\KSC1001.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\KSC5601-1992.map

InstallingC:\Perl64\site\lib\Unicode\Map\EASTASIA\SHIFTJIS.map

Installing C:\Perl64\site\lib\Unicode\Map\IBM\IBM038.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-1.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-10.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-13.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-14.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-15.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-2.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-3.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-4.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-5.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-6.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-7.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-8.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\8859-9.map

Installing C:\Perl64\site\lib\Unicode\Map\ISO\ISO646-US.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP437.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP737.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP775.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP850.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP852.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP855.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP857.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP860.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP861.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP862.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP863.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP864.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP865.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP866.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP869.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\DOS\CP874.map

InstallingC:\Perl64\site\lib\Unicode\Map\MS\EBCDIC\CP037.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\EBCDIC\CP1026.map

InstallingC:\Perl64\site\lib\Unicode\Map\MS\EBCDIC\CP500.map

InstallingC:\Perl64\site\lib\Unicode\Map\MS\EBCDIC\CP875.map

InstallingC:\Perl64\site\lib\Unicode\Map\MS\MAC\CYRILLIC.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\MAC\GREEK.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\MAC\ICELAND.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\MAC\LATIN2.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\MAC\ROMAN.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\MAC\TURKISH.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP1250.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP1251.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP1252.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP1253.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP1254.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP1255.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP1256.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP1257.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP1258.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP932.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP936.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP949.map

Installing C:\Perl64\site\lib\Unicode\Map\MS\WIN\CP950.map

Installing C:\Perl64\site\lib\Unicode\Map\NEXT\NEXTSTEP.map

Installing C:\Perl64\site\bin\map

Installing C:\Perl64\site\bin\map.bat

Installing C:\Perl64\site\bin\mirrorMappings

Installing C:\Perl64\site\bin\mirrorMappings.bat

Installing C:\Perl64\site\bin\mkCSGB2312

Installing C:\Perl64\site\bin\mkCSGB2312.bat

Installing C:\Perl64\site\bin\mkmapfile

Installing C:\Perl64\site\bin\mkmapfile.bat

Appending installation info to C:\Perl64\lib/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:\Rebecca\script\perl\Unicode>perl unicode_test_v1.pl

這是瑞貝卡

How to show Chinese character by using Perl?

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.