Is the uconv utility (a tool from ICU that provides Unicode normalization) available for Mac OS X?
I did not find it in homebrew and searching the web for solutions did not turn out anything useful for me.
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityIs the uconv utility (a tool from ICU that provides Unicode normalization) available for Mac OS X?
I did not find it in homebrew and searching the web for solutions did not turn out anything useful for me.
My solution for you:
brew install icu4c
Read the message after install (nothing is at this moment direct available ...):
==> Caveats, This formula is keg-only, which means it was not symlinked into /usr/local.
brew list icu4c | grep uconv
/usr/local/Cellar/icu4c/55.1/bin/uconv
/usr/local/Cellar/icu4c/55.1/share/man/man1/uconv.1
And after all, here my example for using this tool for normalization (NFC) utf8 text:
/usr/local/Cellar/icu4c/55.1/bin/uconv -f utf-8 -t utf-8 -x NFC ~/Desktop/ue.txt | od -t x1
Not sure if it will suit your needs, but check out iconv
which is coming with osx. Try iconv --list
to list the supported encodings.
man iconv
states "The iconv program converts text from one encoding to another encoding." man uconv
says "uconv converts [...] from one encoding to another"
iconv -f <from_encoding> -t UTF-8-MAC <input>
. Note that the utf-8-mac
character set stands for unicode's NFD
utf-8-mac
is not NFD but a variant of NFD used by HFS+ where certain ranges of characters are not decomposed. printf \\uf900|/usr/local/opt/icu4c/bin/uconv -f utf-8 -t utf-8 -x NFD|xxd -p
prints e8b188
(which is decomposed) but printf \\uf900|iconv -f utf-8 -t utf-8-mac|xxd -p
prints efa480
(which is not decomposed).