将给定文件的编码从一种编码转换为另一种编码。
transencoding的Python项目详细描述
将给定文件的编码从一种编码转换为另一种编码。
安装
pip install transencoding
用法
E:\transencoding>python transencoding.py --help Usage: transencoding.py [OPTIONS] [INPUT] Options: -f, --from-code TEXT Encoding of original text [required] -t, --to-code TEXT encoding for output [required] -o, --output TEXT output file --help Show this message and exit.
示例
“utf8.txt”中分
E:\transencoding>python transencoding.py -f utf8 -t gbk utf8.txt > gbk.txt