[root@wx03 ~]# cat test.pl
use Mojolicious::Lite;
use JSON qw/encode_json decode_json/;
use Encode;
no strict;
use JSON;
use Data::Dumper;
#no  utf8;
# /foo?user=sriget '/admin/api/menu' => sub {my $c = shift;print "测试更健康\n";open (LOG1 ,"<",'/data01/applog_backup/zj-api01-catalina.out') or die  $!;while (<LOG1>) {my $phone='18072722237';#2016-03-09 09:35:12,380 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为132435,本验证码5分钟内有效。 to phoneNo:18072722237 succeed!if ( ($phone) and ($_ =~/$phone/) and ($_ =~/SMSUtils/) ){$str=$_;#  my $d=encode_utf8('验证');my $d='验证';print "1-------\$str is $str\n";next if ($str !~ /$d/);print "2--------\$str is $str\n";push (@arr1 ,$str);}};close LOG1;$c->render(text =>  "测试更健康" );
};app->start;此时接口返回;[root@wx03 ~]# morbo test.pl Server available at http://127.0.0.1:3000
[Thu Jun 30 19:50:58 2016] [debug] GET "/admin/api/menu"
[Thu Jun 30 19:50:58 2016] [debug] Routing to a callback
Wide character in print at /root/test.pl line 11.
测试更健康
1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed![Thu Jun 30 19:50:58 2016] [debug] 200 OK (0.00104s, 961.538/s)/******[root@wx03 ~]# cat test.pl
use Mojolicious::Lite;
use JSON qw/encode_json decode_json/;
use Encode;
no strict;
use JSON;
use Data::Dumper;
#no  utf8;
# /foo?user=sriget '/admin/api/menu' => sub {my $c = shift;print "测试更健康\n";open (LOG1 ,"<",'/data01/applog_backup/zj-api01-catalina.out') or die  $!;while (<LOG1>) {my $phone='18072722237';#2016-03-09 09:35:12,380 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为132435,本验证码5分钟内有效。 to phoneNo:18072722237 succeed!if ( ($phone) and ($_ =~/$phone/) and ($_ =~/SMSUtils/) ){$str=$_;my $d=encode_utf8('验证');#   my $d='验证';print "1-------\$str is $str\n";next if ($str !~ /$d/);print "2--------\$str is $str\n";push (@arr1 ,$str);}};close LOG1;$c->render(text =>  "测试更健康" );
};app->start;[root@wx03 ~]# morbo test.pl
Server available at http://127.0.0.1:3000
[Thu Jun 30 19:52:38 2016] [debug] GET "/admin/api/menu"
[Thu Jun 30 19:52:38 2016] [debug] Routing to a callback
Wide character in print at /root/test.pl line 11.
测试更健康
1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed!2--------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分钟内有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分钟内有效。 to phoneNo:18072722237 succeed![Thu Jun 30 19:52:38 2016] [debug] 200 OK (0.001048s, 954.198/s)/************ 关闭utf-8[root@wx03 ~]# cat test.pl
use Mojolicious::Lite;
use JSON qw/encode_json decode_json/;
use Encode;
no strict;
use JSON;
use Data::Dumper;
no  utf8;
# /foo?user=sriget '/admin/api/menu' => sub {my $c = shift;print "测试更健康\n";open (LOG1 ,"<",'/data01/applog_backup/zj-api01-catalina.out') or die  $!;while (<LOG1>) {my $phone='18072722237';#2016-03-09 09:35:12,380 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为132435,本验证码5分钟内有效。 to phoneNo:18072722237 succeed!if ( ($phone) and ($_ =~/$phone/) and ($_ =~/SMSUtils/) ){$str=$_;#      my $d=encode_utf8('验证');my $d='验证';print "1-------\$str is $str\n";next if ($str !~ /$d/);print "2--------\$str is $str\n";push (@arr1 ,$str);}};close LOG1;$c->render(text =>  "测试更健康" );
};app->start;接口返回;[root@wx03 ~]# morbo test.pl
Server available at http://127.0.0.1:3000
[Thu Jun 30 19:55:09 2016] [debug] GET "/admin/api/menu"
[Thu Jun 30 19:55:09 2016] [debug] Routing to a callback
测试更健康
1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed!2--------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的验证码为813231,本验证码30分钟内有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分钟内有效。 to phoneNo:18072722237 succeed!1-------$str is 2016-04-22 11:02:01,259 INFO com.zjzc.thirdparty.sms.SMSUtils - Send message:您的813231,本30分钟内有效。 to phoneNo:18072722237 succeed![Thu Jun 30 19:55:09 2016] [debug] 200 OK (0.001001s, 999.001/s)

转载于:https://www.cnblogs.com/zhaoyangjian724/p/6199751.html

mojo 关闭utf8相关推荐

  1. 关于JAVA字符编码:Unicode,ISO-8859-1,GBK,UTF-8编码及相互转换

    出处: https://www.cnblogs.com/haimishasha/p/6117968.html 目录 1.1. ISO-8859-1 通常叫做Latin-1 1.2. GB2312/GB ...

  2. java linux urlencode_java字符编码转换研究(转)

    1. 概述 本文主要包括以下几个方面:编码基本知识,java,系统软件,url,工具软件等. 在下面的描述中,将以"中文"两个字为例,经查表可以知道其GB2312编码是" ...

  3. 【JAVA编码专题】 JAVA字符编码系列三:Java应用中的编码问题

    这两天抽时间又总结/整理了一下各种编码的实际编码方式,和在Java应用中的使用情况,在这里记录下来以便日后参考. 为了构成一个完整的对文字编码的认识和深入把握,以便处理在Java开发过程中遇到的各种问 ...

  4. java encode in ansi_Java应用中的编码问题

    1. 概述 本文主要包括以下几个方面:编码基本知识,java,系统软件,url,工具软件等. 在下面的描述中,将以"中文"两个字为例,经查表可以知道其GB2312编码是" ...

  5. unix系统编码 java_JAVA字符编码系列三:Java应用中的编码问题

    这两天抽时间又总结/整理了一下各种编码的实际编码方式,和在Java应用中的使用情况,在这里记录下来以便日后参考. 为了构成一个完整的对文字编码的认识和深入把握,以便处理在Java开发过程中遇到的各种问 ...

  6. 字符,字节和编码三者的关系

    转载自http://www.blogjava.net/fundei/ 1. 编码问题的由来,相关概念的理解 1.1 字符与编码的发展 从计算机对多国语言的支持角度看,大致可以分为三个阶段: 系统内码 ...

  7. Perl Unicode全攻略

    分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! 转载:h ...

  8. perl unicode

    [+] 目录(?)[-] 实例详细介绍各种字符集编码转换问题 转 Perl对中文的处理问题 perl对中文的处理encodedecode perl与中文信息处理 一文件分割 二字频统计 三回文 CMD ...

  9. jsp未正确拼写字 mysql_JAVA字符编码

    UCS-2, 与unicode的2byte编码基本一样. UCS-4, 4byte编码, 目前是在UCS-2前加上2个全零的byte. UTF:Unicode/UCS Transformation F ...

最新文章

  1. python 连接db2_大迷糊的博客
  2. Vmware学习虚拟机操作时遇到的问题和解决
  3. php ajax实现的二级(多级)联动菜单(2008-10-21,11:36:08)
  4. 科大星云诗社动态20210511
  5. 网易云信即时通讯推送保障及网络优化详解(三):如何在弱网环境下优化大数据传输
  6. Windows Server 2008 R2安装Zune 4.0解决方法
  7. json对象数组按对象属性排序
  8. docker部署resin应用
  9. Linux设备驱动模型1——简介和底层架构
  10. 计算机系统的主要功能要求,计算机系统的主要功能是什么
  11. 【c++基础】菱形继承问题
  12. 宏转录组方法_中山大学医学院施莽教授学术讲座:宏转录组方法在病原生物学领域的应用...
  13. julia 调用python库_install julia with python
  14. 药店app的布局html,APP首页常用排版
  15. 【整理】基因编辑最新进展
  16. 交换机分布缓存_一种交换机的缓存管理方法
  17. Ansible9:变量之Fact
  18. java月亮代码_Java编程实现月食简单代码分享
  19. Vscode连接远程服务器出现‘Acquiring lock on/home/~’问题
  20. 多元线性回归案例(改)

热门文章

  1. java精确测量文本高度_Android精确测量文本宽高及基线位置的方法
  2. Java中static的作用详解_java中static作用详解
  3. Pytorch Merge操作
  4. Python使用@property方法改变方法为参数
  5. 如何使用vscode安装和调试Java程序
  6. UNITY2018开启deepprofiling
  7. centos6.8_64部署django项目
  8. Struts的基础案例的步骤
  9. IOS开发基础知识--碎片39
  10. YARN环境搭建 之 一:CentOS7.0系统配置