Files
tldr/pages.zh/common/enca.md

20 lines
590 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# enca
> 检测和转换文本文件的编码。
> 更多信息:<https://github.com/nijel/enca>。
- 根据系统的区域设置检测文件编码:
`enca {{path/to/file1 path/to/file2 ...}}`
- 指定POSIX/C区域格式的语言例如zh_CNen_US检测文件编码
`enca -L {{language}} {{path/to/file1 path/to/file2 ...}}`
- 将文件转换为特定编码:
`enca -L {{language}} -x {{to_encoding}} {{path/to/file1 path/to/file2 ...}}`
- 使用不同的编码创建现有文件的副本:
`enca -L {{language}} -x {{to_encoding}} < {{original_file}} > {{new_file}}`