jrhapt01:/home/tomcat/test> cat a2.pl
my $str="$ARGV[0]";
use Encode;
use URI::Escape;
use LWP::Simple;
$str =~ s/\\u([0-9a-fA-F]{4})/pack("U",,hex($1))/eg;
print $str;
print "\n";
jrhapt01:/home/tomcat/test> perl a2.pl "\u767b\u5f55\u6210\u529f"
Wide character in print at a2.pl line 6.
登录成功 jrhapt01:/home/tomcat/test> cat a2.pl
my $str="$ARGV[0]";
use Encode;
use URI::Escape;
use LWP::Simple;
$str =~ s/\\u([0-9a-fA-F]{4})/pack("U",,hex($1))/eg;
print encode_utf8($str);
print "\n";
jrhapt01:/home/tomcat/test> perl a2.pl "\u767b\u5f55\u6210\u529f"
登录成功 encode_utf8 作用:
jrhapt01:/home/tomcat/test> cat a3.pl
my $str="中均";
print "\$str is $str\n"; use Encode;
print "111111111111111111\n";
my $var= encode_utf8($str);
print "\$var is $var\n";
print decode_utf8($var);
print "\n"; jrhapt01:/home/tomcat/test> perl a3.pl
$str is 中均
111111111111111111
$var is 中均
中均 $octets = encode_utf8($string);
Equivalent to "$octets = encode("utf8", $string);" The characters that comprise $string are encoded in Perl’s internal format and the result is returned as a sequence of octets. All
possible characters have a UTF-8 representation so this function cannot fail. 等价于 "$octets = encode("utf8", $string);" 字符串构成$string 是编码成perl的内部格式,结果是 一个有序的8位字节 所有可能的字符串有一个UTF-8 表示 $string = decode_utf8($octets [, CHECK]);
equivalent to "$string = decode("utf8", $octets [, CHECK])". The sequence of octets represented by $octets is decoded from UTF-8 into a sequence of logical characters. Not all
sequences of octets form valid UTF-8 encodings, so it is possible for this call to fail. For CHECK, see "Handling Malformed Data". 等价于 "$string = decode("utf8", $octets [, CHECK])". 8位字节的顺序是被解码从UTF-8 到一个逻辑字符的顺序

Wide character in print at a2.pl line 6.的更多相关文章

  1. Wide character in print at a2.pl line 返回json 需要encode_utf8

    centos6.5:/root/test#cat a2.pl use Net::SMTP; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Heade ...

  2. perl unload utf-8 oracle Wide character in print at unload_oracle.pl line 105.

    #!/usr/bin/perl use DBI; use Encode; my $dbName = 'oadb'; my $dbUser = 'vxspace'; my $dbUserPass = ' ...

  3. Wide character in print at hcp.pl line 21.

    jrhmpt01:/root# cat -n hcp.pl 1 use LWP::UserAgent; 2 use Encode; 3 $ua = LWP::UserAgent->new; 4 ...

  4. 为什么出现Wide character in print at a14.pl line 41

    [root@wx03 ~]# cat a14.pl use Net::SMTP; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Headers; u ...

  5. php 返回json 解析 报Wide character in print

    php 返回json: zabbix:/var/www/html/DEVOPS/Home/Lib/Action# vim EquipmentAction.class.php <?php head ...

  6. Can't locate find.pl in @INC (@INC contains: /etc/perl xxxx) at perlpath.pl line 7.

    /********************************************************************** * Can't locate find.pl in @I ...

  7. error: converting to execution character set: Invalid or incomplete multibyte or wide character

    交叉编译.c文件,遇到如下问题 arm-linux-gcc -o show_lines show_lines.c -lfreetype -lm show_lines.c:199:19: error: ...

  8. SyntaxError: Non-ASCII character 'æ' in file csdn.py on line 7, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

    错误信息: SyntaxError: Non-ASCII character , but no encoding declared; see http://python.org/dev/peps/pe ...

  9. 编译内核错误:Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373

    最近在编译一个新的rk sdk的时候,编译内核报错 CHK include/linux/version.h CHK include/generated/utsrelease.h make[1]: 'i ...

随机推荐

  1. StyleCop 安装

    下载安装 官方网站:http://stylecop.codeplex.com/ 下载安装 如果自定义了安装路径请保证这个文件的AssemblyFile 属性正确的指向了StyleCop.dll所在的目 ...

  2. js页面之间函数调用

    1.在父级页面调用子级页面的函数 当前页面(default.aspx)通过iframe嵌套index.aspx页面,在当前页面调用index.aspx里面的js函数,如下: myFrame.windo ...

  3. Android设计模式系列

    http://www.cnblogs.com/qianxudetianxia/category/312863.html Android设计模式系列(12)--SDK源码之生成器模式(建造者模式) 摘要 ...

  4. windows 定时任务

    创建定时任务 创建定时任务,时间间隔为1min,开始时间为04:00:00,任务名称为backupSchedule,运行当前目录下的copyData.bat脚本 schtasks /create /s ...

  5. 浅谈break 、continue、return,goto四种语句的区别。

    浅谈break .continue.return三种语句的区别: break,continue,return这三个具有跳转功能的语句在c语言中经常被用到,近期身边有些小伙伴总是把它们的用法搞乱,在这里 ...

  6. MVVM学习笔记

    MVVM学习笔记 1.MVVM的简介 MVVM模式是Model-View-ViewModel模式的简称,也就是由模型(Model).视图(View).视图模型(ViewModel),其目的是为了实现将 ...

  7. java图片高质量缩放类

    import java.awt.Color;import java.awt.Graphics;import java.awt.Image;import java.awt.image.BufferedI ...

  8. Mysql笔记【4】-查询操作

    1.查询所有列数据 select * from 表名 一般情况下,除非使用表中所有字段,最好不要使用通配符 "*",如果不知道所需要的列名,可以使用*查询获取 2.带in关键字的查 ...

  9. 02_使用WebMagic爬虫获取CSDN推荐专家的个人博客信息

    本来是想抓取博客园的博客推荐的页面的,但由于一些博客进去的页面格式都不太相同,一时不想花时间去寻找规律,发现CSDN上面的格式较为单一,就决定以CSDN推荐专家的个人博客信息作为爬虫抓取的目标. [首 ...

  10. 【转】JavaScript闭包

      摘自:JavaScript作用域闭包简述 使用外部变量的函数就是闭包,闭包可以给我们带来一些便利,就是可以在高等级的作用域使用低等级作用域中的变量:   例: var data = []; fun ...