Re:What it takes to pass a file path to a Windows API in C++
by Affric on Sunday September 24, 2023 @05:54PM
(#37637555)
Thanks for the comment. HFS/HFS+ is a fascinating bit of history.
It strikes me how developer ergonomics have improved as computers have become cheaper/increased in power.
As to UTF-8, we may say it’s young but in 14 months it will be old enough to purchase and consume alcohol in the United States. From other comments it seems like Microsoft don’t think the tech debt is too great so long as they have good libraries in C#
HFS+ (which is what you'll find on OSX volumes) uses UTF-16 but then mandates its own quirky normalization and either Unicode 2.1 or 3.2 decomposition depending… which can create headaches because most HFS+ volumes are case-insensitive. It's been so long since I've touched anything Cocoa, but I assume the file APIs will do the UTF-16 dance for you and the POSIX stuff is obviously OK with ASCII.
And, of course, let's not forget the heavily leveraged resource forks. Of course NTFS has forks but nobody seems to use them.
APFS standardized on Unicode 9 w/ UTF-8.
CDs? Microsoft's long filenames (Joliet) use big endian UTF-16 (via ISO escape sequences that theoretically could be used to offer UTF-8 support). Which sounds crazy until you realize their relative simplicity (a duplicate directory structure) compared to the alternative Rockridge extensions which store LFNs in the file's metadata with no defined or enforced encoding. UDF? Yeah that's more or less UTF-16 as well.
I think we're perhaps forgetting just how young UTF-8 is.