|→||1.6 Text tools|
Show text file contents, change encoding if necessary
|Convert file from UTF-8 to UTF-16|
|Convert file from UTF-16 to UTF-8|
|Copyright and license|
dk-cat [options] [files]
The dk-cat program shows text files and can change the encoding between ASCII, UTF-8, UTF-16 or 32-bit UNICODE. The systems default encoding is used for output unless you specify a different encoding using the -o option. Input encoding is found automatically when a BOM is found at start of text, otherwise you can specify an expected encoding using the -i option or expect the systems default encoding.
(use for ISO-8859-1 too)
|UTF-16 in the systems default endianness|
|UTF-16 little-endian (least significant byte first)|
|UTF-16 big-endian (most significant byte first)|
|c32||32 bit UNICODE in the systems default endianness|
|32 bit UNICODE little-endian (least significant byte first)|
|32 bit UNICODE big-endian (most significant byte first)|
When producing UTF-16 or 32
bit UNICODE output a BOM is written at start of output. You can
suppress the BOM by appending ``nobom'' to the encoding, i.e.
To require a BOM you can append ``bom'' to the encoding, i.e. ``-o utf-8,bom''.
0 on success, all other exit status codes indicate an error.
If you have a text file created on a recent Linux system in UTF-8 encoding and you want to view or process it on Windows, run
dk-cat -i utf-8 -o utf-16,bom < input > output
If you edited a file on Windows in an editor (i.e. notepad) it is either in ASCII or in UTF-16-LE encoding. Specify ASCII as default encoding, if the file is in UTF-16-LE it has a BOM at start.
dk-cat -i ascii -o utf-8 < input > output
When using wildcard file names on Windows (names containing * or ? placeholders), the file name length is restricted to 260 characters.
This program uses DK libraries version 4.
The program replaces the ``dkt cat'' from DK tools 3.x.x.
See the Legal stuff page for copyright and license information.