• utf-8和gbk切换


    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
    

  • 相关阅读:
    数据库
    数据库
    数据库
    数据库
    数据库
    数据库
    windows
    LeetCode : Word Pattern
    LeetCode : Perfect Number
    LeetCode : Minimum Depth of Binary Tree
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351442.html
Copyright © 2020-2023  润新知