Converts UTF-8 input to the desired UTF-8 in Unicode normalization form.
Read about the Unicode Normalization Forms!
There are five executables included, that all have the exact same usage and arguments:
- unormalize
- nfc
- nfd
- nfkc
- nfkd
You may either redirect or pipe input into unormalize (and its buddies), or provide filenames as arguments.
-f FORM/--form=FORM- Selects the normalization form: one of NFC, NFD, NFKC, or NFKD. The
equivalently named executables imply their respective normalization form;
unormalizeis equivilent tonfkwithout the--formarugment. -i EXTENSION/--in-place EXTENSION- Filenames must be specified as arguments. If so, this opens them, and
converts them into the desired normalization form, in place.
EXTENSIONis the extension given to back-ups of the original files.
Convert clipboard contents to NFC (macOS):
$ pbpaste | nfc | pbcopy
Convert a file, in-place, to NFKD:
$ nfkd --in-place=.bak file.txt && rm file.txt.bak
Convert circled, variants, and half-widths to their compatible forms:
$ echo 'ℍ①カ' | nfkc H1カ
© 2015, 2017, 2020 Eddie Antonio Santos. MIT Licensed.