How are we still not past three-splitting content…
It’s not as shit as twitter UI/UX/Accessibility - but this mastodon split-post doesn’t make me feel much better.
/edit: Actually, it’s a 5-split.
I’ll do what lemmy-post-OP didn’t and copy the content for accessibility:
Ashley Gullen:
If you thought JavaScript was a mess, here’s what it takes to pass a file path to a Windows API in C++: 🧵
Windows uses UTF-16, but most modern software uses UTF-8
Converting UTF-8 to UTF-16 requires calling MultiByteToWideChar twice (once for size, second to convert)
Alternatively you can set the process code page to UTF-8 and call the ‘A’ variant API directly, but only sometimes, and only with Windows 10 v1903+, and you might still have to change the system locale setting and reboot
Now you can pass a file path! But…
The path is limited to MAX_PATH (260 chars)
Unless you prefix the path with \\?\
However using \\?\ disables automatic conversion of / to \ in the path (and some other normalization)
Alternatively set a reg key LongPathsEnabled, but only with Windows 10 v1607+ and the app needs to opt in to longPathAware, and changing the registry might need a reboot
Even then not all Windows APIs support longer paths, e.g. PathCanonicalize. Swap for PathCchCanonicalizeEx with PATHCCH_ALLOW_LONG_PATHS, etc. Check docs per API.
Congratulations, your app can pass a long file path to Windows! But the shell still doesn’t support long paths. So your app can write to long paths, but you can’t access them with Windows Explorer. Even in Windows 11.
If the API returns a path, do all that in reverse.
How are we still not past three-splitting content…
It’s not as shit as twitter UI/UX/Accessibility - but this mastodon split-post doesn’t make me feel much better.
/edit: Actually, it’s a 5-split.
I’ll do what lemmy-post-OP didn’t and copy the content for accessibility:
Ashley Gullen: