How to show Chinese character by using Perl?

Source: Internet
Author: User

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 have not been updated.

Testing script:

#! /usr/bin/perl

Use strict;

Use Unicode::map;

My $Map = new Unicode::map ("GB2312");

My $utf = $Map->to_unicode ("This is Rebecca");

My $locale = $Map->from_unicode ($utf 16);

print "$locale";

Execution Result:

C:\rebecca\script\perl\unicode>perl unicode_test_v1.pl

This is Rebecca.

How to show Chinese character by using Perl?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.