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