2016-01-05 01:32:37 +00:00
|
|
|
# enca
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Detect and convert 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
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Detect file(s) encoding according to your system's locale:
|
2016-01-05 01:32:37 +00:00
|
|
|
|
|
|
|
`enca {{file(s)}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- 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)}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Convert file(s) to specified encoding:
|
2016-01-05 01:32:37 +00:00
|
|
|
|
|
|
|
`enca -L {{language}} -x {{to_encoding}} {{file(s)}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- 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}}`
|