Linux编码转换相关:修订间差异

来自三线的随记
(创建页面,内容为“=== command or tools === * vim -> set fileencoding * convmv -> 转换文件名编码 * iconv -> 单文件转换 * enca === enca的相关补充 === <blockquote>enca…”)
 
无编辑摘要
第1行: 第1行:
=== command or tools ===
===command or tools===
* vim -> set fileencoding
* convmv -> 转换文件名编码
* iconv -> 单文件转换
* enca


=== enca的相关补充 ===
*vim -> set fileencoding
<blockquote>enca --help</blockquote><blockquote>Usage:  enca [-L LANGUAGE] [OPTION]... [FILE]...</blockquote><blockquote>        enconv [-L LANGUAGE] [OPTION]... [FILE]...</blockquote><blockquote>Detect encoding of text files and convert them if required.</blockquote>但是实际上enca并不是单纯的enconv别名关系的样子<blockquote>root@miniServer:/var/www# enca -L zh_CN News.csv</blockquote><blockquote>Universal transformation format 8 bits; UTF-8</blockquote><blockquote>root@miniServer:/var/www# enconv -L zh_CN News.csv</blockquote><blockquote>enconv: Cannot detect native charset for locale zh.</blockquote><blockquote>You have to use the `-x' option or the DEFAULT_CHARSET environment variable to set the target encoding manually.</blockquote><blockquote>root@miniServer:/var/www# </blockquote>
*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
<br />
[[分类:Linux]]
[[分类:Linux]]

2020年7月23日 (四) 22:01的版本

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