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 $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.的更多相关文章
- 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 ...
- 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 = ' ...
- 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 ...
- 为什么出现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 ...
- php 返回json 解析 报Wide character in print
php 返回json: zabbix:/var/www/html/DEVOPS/Home/Lib/Action# vim EquipmentAction.class.php <?php head ...
- Can't locate find.pl in @INC (@INC contains: /etc/perl xxxx) at perlpath.pl line 7.
/********************************************************************** * Can't locate find.pl in @I ...
- 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: ...
- 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 ...
- 编译内核错误: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 ...
随机推荐
- Unity3D 之UGUI 文本框和编辑框
这里来讲解一下unity3D自带的UI功能,自带的UI也叫UGUI功能非常的强大,比起NGUI,更加的灵活,让用户能够更加容易的去使用. 首先创建一个文本Text 然后是文本相对应的属性 这里的属性比 ...
- c语言学习之基础知识点介绍(十一):字符串的介绍、使用
本节主要介绍c语言中的字符串的应用. 一:字符串介绍 因为c语言中没有像Java.C#那样的字符串类型,所以无法直接用字符串.需要借助数组来解决这个问题. /* 定义:把多个字符连在一起就叫字符串.但 ...
- 关于bootstrap的datepicker在meteor应用中的使用(不包含bootstrap框架)
1.安装bootstrap3-datepicker包 meteor add rajit:bootstrap3-datepicker 2.使用方法 Example In your handlebars ...
- Objective-c单例模式详解
转载自:http://www.jianshu.com/p/85618bcd4fee 单例模式出现以后,关于它的争执就一直存在.在开发项目中,有很多时候我们需要一个全局的对象,而且要保证全局有且仅有一份 ...
- c#md5与SHA1验证函数
/// <summary> /// MD5验证函数 /// </summary> /// <param name="fileName">文件的路 ...
- ubuntu 安装 桌面 awesome
受了ubuntu 12.04自带的桌面,运行太卡了 http://www.linuxzen.com/awesometmuxgnomedoda-zao-gao-xiao-linuxzhuo-mian-h ...
- nodejs -formidable模块实现图片上传。
var form = new formidable.IncomingForm(); form.uploadDir="/localnonobank/test/images/"; ...
- (转载)Delphi StringGrid常用属性和常用操作
Delphi StringGrid常用属性和常用操作 StringGrid组件用于建立显示字符串的网格,与电子表格相似.它可使表格中的字符串和相关对象操作简单化.StringGrid组件提供了许多可控 ...
- 有关sybase的一些零星经验
clear transaction log >dump transaction master with truncate_only >dump transaction master wit ...
- 头文件的宏定义#ifndef测试
一.入题 在头文件的书写中,都加入了如下内容: #ifndef __头文件名_H #define __头文件名_H #endif 曾经在书中看到的解释是“防止重复定义”,今天突然想到为什么是这样的解释 ...