tldr/pages/common/enca.md

21 lines
639 B
Markdown
Raw Normal View History

2016-01-05 01:32:37 +00:00
# enca
> Detect and convert the encoding of text files.
2019-06-08 01:04:00 +01:00
> More information: <https://github.com/nijel/enca>.
2016-01-05 01:32:37 +00:00
- Detect file(s) encoding according to the system's locale:
2016-01-05 01:32:37 +00:00
`enca {{path/to/file1 path/to/file2 ...}}`
2016-01-05 01:32:37 +00:00
- Detect file(s) encoding specifying a language in the POSIX/C locale format (e.g. zh_CN, en_US):
2016-01-05 01:32:37 +00:00
`enca -L {{language}} {{path/to/file1 path/to/file2 ...}}`
2016-01-05 01:32:37 +00:00
- Convert file(s) to a specific encoding:
2016-01-05 01:32:37 +00:00
`enca -L {{language}} -x {{to_encoding}} {{path/to/file1 path/to/file2 ...}}`
2016-01-05 01:32:37 +00:00
- Create a copy of an existing file using a different encoding:
2016-01-05 01:32:37 +00:00
`enca -L {{language}} -x {{to_encoding}} < {{original_file}} > {{new_file}}`