sutf1
Convert encoding of text files
Usage
sutf [OPTIONS ...]
[INPUTFILES ...]
Overview
sutf converts the encoding of text files from one encoding to another using the high-performance simdutf library for supported formats. For unsupported formats, it falls back to iconv if available.
Options
-
-f, --from-code=ENCODING -
Encoding of source text (mandatory).
-
-t, --to-code=ENCODING -
Encoding of output (mandatory).
-
-o, --output=FILE -
Output file. If not specified, output goes to standard output.
-
-h, --help -
Display help text and exit.
-
-u, --usage -
Display short usage message and exit.
-
-l, --list -
Display supported formats and exit.
Supported formats
Formats supported by simdutf library: UTF-8, UTF-16LE, UTF-16BE, UTF-32LE
If iconv is available, additional formats supported by iconv are also available.
Examples
- Convert UTF-16LE file to UTF-8:
-
sutf -f UTF-16LE -t UTF-8 input.txt
- Convert multiple files and save to output file:
-
sutf -f UTF-8 -t UTF-16BE -o output.txt file1.txt file2.txt
- List supported formats:
-
sutf --list