hzcya1995
gbk转utf-8,需要在utf-8环境下转

jrhnpt01:/root# echo $LANG
zh_CN.gbk
jrhnpt01:/root# ls -ltr *.txt
-rw-r--r-- 1 root root 0 8月  21 22:17 测试.txt


jrhnpt01:/root# echo $LANG
zh_CN.UTF-8
jrhnpt01:/root# ls -ltr *.txt
-rw-r--r-- 1 root root 0 8月  21 22:17 ????.txt
jrhnpt01:/root# perl t.pl ????.txt
$str is 测试.txt


utf-8转gbk,需要在gbk环境下转
jrhnpt01:/root# echo $LANG
en_US.UTF-8
jrhnpt01:/root# ls -ltr *.txt
-rw-r--r-- 1 root root 0 Aug 21 22:24 测试.txt

jrhnpt01:/root# echo $LANG
zh_CN
jrhnpt01:/root# perl t1.pl ??????.txt
$str is 测试.txt

分类:

技术点:

相关文章:

  • 2021-12-10
  • 2021-10-07
  • 2021-10-17
  • 2021-09-11
  • 2021-09-01
  • 2021-11-30
猜你喜欢
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2019-08-11
  • 2021-11-30
  • 2021-10-07
相关资源
相似解决方案