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