News for hackers. Stuff that matters.
Re:WorstFit: Unveiling Hidden Transformers in Windows ANSI by account42 on Wednesday January 15, 2025 @07:52AM (#42710310)
> This is also true on Unix systems as to `char`. Yes, that means there will be loss of information regarding paths that have garbage in them. And again, if you want to write code for Windows _and_ Unix, using wchar_t won't spare you this loss on Unix. So you're damned if you do and damned if you don't, so just accept this loss and say "don't do that".

The problem is that you can't roundtrip all filenames. CP_UTF8 doesn't solve that only pretends to. For a full solution you need to use the W functiosn and then convert between WTF-16 and WTF-8 yourself.

There are no comments on this comment yet.