iconv

From RaySoft

The iconv program converts text from one encoding to another encoding. More precisely, it converts from the encoding given for the −f option to the encoding given for the −t option.[1]

Documentation

Syntax

iconv [PARAMETER ...] [FILE ...]

Parameters

−c
When this option is given, characters that cannot be converted are silently discarded, instead of leading to a conversion error.
−f ENCODING, −−from−code=ENCODING
Specifies the ENCODING of the input.
−l, −−list
Lists the names of the supported encodings, in a system dependent format.
−t ENCODING, −−to−code=ENCODING
Specifies the ENCODING of the output.

Examples

List the supported encodings
iconv −−list
Work with German special characters (like äöü) in the macOS' file system HFS+
pattern="$(iconv --to-code='UTF-8-MAC' <<<'ausrüstung.md')"

find "${HOME}" -type 'f' -name "*/${pattern}"
NOTE:
UTF-8-MAC is a special encoding which is only available on macOS.

References

  1. man 1 'iconv'