Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That is due to the HFS+ normalization that APFS eliminates. The filename is stored in UTF-16 and OS X converts it to UTF-8.


Normalization and UTF-16 are completely orthogonal. It doesn't matter in the slightest whether the filesystem stores the filename in UTF-16 or UTF-8, either way it's still a sequence of Unicode scalar values, and that's what matters.


HFS does a lot more than convert to UTF-8. E.g. it will normalize ö to o+(umlaut), using custom normalization rules that nobody else uses.

If you tell HFS to store a file with an Ö in it, and then list the directory, the character Ö is nowhere to be found.


Is it stored "real UTF-16" or in USC2 wide-chars like in NTFS? The later would be a big problem.


I believe HFS+ was created before Mac OS supported surrogates.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: