Linux编码转换相关
来自三线的随记
command or tools
- vim -> set fileencoding
- convmv -> 转换文件名编码
- iconv -> 单文件转换
- enca
enca的相关补充
enca --help Usage: enca [-L LANGUAGE] [OPTION]... [FILE]... enconv [-L LANGUAGE] [OPTION]... [FILE]... Detect encoding of text files and convert them if required.
但是实际上enca并不是单纯的enconv别名关系的样子
root@miniServer:/var/www# enca -L zh_CN News.csv Universal transformation format 8 bits; UTF-8 root@miniServer:/var/www# enconv -L zh_CN News.csv enconv: Cannot detect native charset for locale zh. You have to use the `-x' option or the DEFAULT_CHARSET environment variable to set the target encoding manually.
iconv
echo xxxx | iconv -f gbk -t utf8