#Perl中检测标准输入使用的字符集

sub locale_encode{

my $lang = $ENV{'LANG'};

my $dot_pos = rindex($lang, '.');


my $encode = $dot_pos < 0 ?$lang : substr($lang, $dot_pos+1);


$encode = $encode eq ''? 'utf8': $encode;

}

#使用方法

# print locale_encode;

#

最新文章

  1. hibernate优化笔记(随时更新)
  2. nodejs 生产环境配置
  3. 通过HostOnly Cookie为Cookie正确的设置一级域名
  4. Centos6一键搭建L2TP VPN服务器
  5. 负载均衡服务器session共享的解决方案 (转载)
  6. 【转】Ajax中send方法参数的使用(get/post)
  7. WINAPI 变量(2861个)
  8. iOS 中如何监测某段代码运行的时间
  9. django: db - many to one
  10. Baidu Sitemap Generator插件使用图解教程
  11. java web项目修改项目名称
  12. Python 函数基础、有序集合、文件操作(三)
  13. Spring配置DataSource数据源
  14. configure: error: zlib not installed
  15. .NET Mvc Razor
  16. ColumnEdit 数据源修改
  17. Python -- lambda, map, filter
  18. React-native初体验(安卓篇)
  19. python编程基础—正则表达式
  20. eclipse从git拉去出现红色方块的解决办法

热门文章

  1. string的不可变性
  2. SRM 582 Div II Level Two SpaceWarDiv2
  3. 14.1.1 InnoDB as the Default MySQL Storage Engine
  4. linux系统日志及其rsyslog服务
  5. SQL server语句练习
  6. hdu5086——Revenge of Segment Tree
  7. 【数据库摘要】12_Sql_存储过程
  8. 很好用的一个类:TJvAppXMLFileStorage
  9. 卸载QTP
  10. JQuery选择器操作