tldr/pages/common/enca.md

20 lines
560 B
Markdown
Raw Normal View History

2016-01-05 01:32:37 +00:00
# enca
> Detect and convert encoding of text files.
2016-01-05 01:32:37 +00:00
- Detect file(s) encoding according to your system's locale:
2016-01-05 01:32:37 +00:00
`enca {{file(s)}}`
- Detect file(s) encoding; -L option tells enca the current language; language is in the POSIX/C locale format, e.g. zh_CN, en_US etc:
2016-01-05 01:32:37 +00:00
`enca -L {{language}} {{file(s)}}`
- Convert file(s) to specified encoding:
2016-01-05 01:32:37 +00:00
`enca -L {{language}} -x {{to_encoding}} {{file(s)}}`
- Save original_file as new_file and convert new_file to specified encoding:
2016-01-05 01:32:37 +00:00
`enca -L {{language}} -x {{to_encoding}} < {{original_file}} > {{new_file}}`