What the difference and usage of encodings UTF-8 and UTF-8-MAC in iconv?
I thought it was the difference between \n and \r(MAC OS 9) at first.
But I tried iconv -f UTF-8 -t UTF-8-MAC filename > filename2
The file content doesn't change in hex view.
MacOS – What the difference and usage of encodings UTF-8 and UTF-8-MAC in iconv
macosunicodeutf-8
Related Question
- MacOS – difference “defaults read” and “defaults export”
- MacOS – Difference between network service disabled, inactive and interface down
- About converting to UFT8 from a “Simplified Chinese” file having a “garbled” file name
- MacOS – the difference between FileVault 2 and Disk Utility Encryption
- MacOS – the difference between this disks (0 and 1) on the Mac
- Rsync keeps copying the same file
Best Answer
As explained here, utf-8-mac is the utf 8 version of a text after application of Unicode normalization NFD (e.g accented characters are represented by the base character plus a combining accent character), with certain codepoint ranges excluded from the decomposition operation.
For example character é can be represented in two different equally valid ways in Unicode:
UTF-8-MAC will ensure that the second, decomposed form is always used.