In my script I need to “qw” some chinese character into a string . when I run the script ,
perl conplains that there is unrecognized character in the script . Although I know it must related to encode related stuff , but I don’t know how to solve it . so turn to you for help .
thanks in advance .
Embedding literal strings in Perl source code is easy. Use the
utf8pragma. (Do not use theencodingpragma, it is highly problematic.)Your text editor must save this file as UTF-8, too.
Then, if you want to output Perl strings, you must encode them first, see perlunitut and perlunifaq.
I also want to advise you that since the year 2006 support for the national standard GB18030 is mandatory for all software products in the PRC – you have to install Encode::HanExtra from CPAN.