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. .NET 统一用户管理 -- 统一鉴权

    统一鉴权 目的 为什么要统一鉴权了,每一个业务系统几乎都离不开,用户,角色,权限 这个 3个基础功能,为了避免各个系统各自去开发一套权限管理等基础功能,也同时轻松管理每个用户的全部权限. 怎么做   ...

  2. CAS 单点登录,通过ticket 获取登录用户

    string url =SSOValidate+"?service=" + WebValidate + "&ticket=" + Ticket + &q ...

  3. 将vs2012的项目转化成VS2010

    vs2012生成的项目,如何在只装有VS2010的电脑上打开, 步骤: 1.打开一个记事本,将你的Vs2012生成的项目解决方案文件(.sln文件)文件拖到记事本中 2.修改前两行  Microsof ...

  4. CSS 的选择符

    CSS是什么? 如果说元素是标记代码的构建块料,那么CSS就是约束这些构建块料样式的规则. CSS规则的组成 CSS的规则由 选择符 和属性,值组成. Css选择符:选择符是规则中用于确定样式所涵盖的 ...

  5. JavaScript—赋值表达式-1

    赋值表达式的运算顺序是从右到左的,因此,可以通过以下方法对多个变量赋值 i=j=k=0;//也就是把三个变量初始化为0 赋值表达式中的递增和递减 n++和++n的区别: 简单来说,根据运算顺序,n++ ...

  6. UVA 11549 CALCULATOR CONUNDRUM(Floyd判圈算法)

    CALCULATOR CONUNDRUM   Alice got a hold of an old calculator that can display n digits. She was bore ...

  7. Cogs 1008. 贪婪大陆(树状数组)

    贪婪大陆 难度等级 ★★ 时间限制 1000 ms (1 s) 内存限制 128 MB 测试数据 10 简单对比 输入文件:greedisland.in 输出文件:greedisland.out 简单 ...

  8. 封装一个自己的 Ajax小框架

    框架代码如下: // 使用封装方法的人只关心提供http的请求方法,url地址,数据,成功和失败的回调方法 // 类的构造定义,主要职责就是新建出 XMLHttpRequest 对象 var MyXM ...

  9. 使用localstorage及js模版引擎 开发 m站设想

    目前 m站开发的方式,依然请求完整的html,这样造成的问题就是每次请求的数据量过大过多,在没有wifi的情况下,导致页面打开的速度很慢,耗费的流量也较多:访问m站的多是移动端设备,其浏览器的版本都较 ...

  10. css按钮自适应

    原理:利用a标签和i标签各自一个背景组合成为按钮,达到自适应. <!DOCTYPE html> <html> <head> <meta charset=&qu ...