Lukas on Nostr: So you're developing a cross-platform library that deals with filenames as a const ...
So you're developing a cross-platform library that deals with filenames as a const char * (or the equivalent thereof)? On Windows, please treat the the filenames as UTF-8 and internally convert them to UTF-16 to call the Unicode Windows APIs or only have a wchar_t* function available.
DO NOT pass the filename as-is to the ANSI Windows APIs. With char * being treated as UTF-8 encoded text, this appears to work until an umlaut or another non-ASCII character appears in a filename.
Thank you.
Published at
2024-04-14 19:44:35Event JSON
{
"id": "8ee009a096766527708ea1c6e1da90867c5ef5020e2f79363d96857aa7d964f8",
"pubkey": "fba896b7fd6224784111757a762a4489f5f35a85d9392e7ece875b8651816923",
"created_at": 1713123875,
"kind": 1,
"tags": [
[
"proxy",
"https://chaos.social/users/karotte/statuses/112271286289258358",
"activitypub"
]
],
"content": "So you're developing a cross-platform library that deals with filenames as a const char * (or the equivalent thereof)? On Windows, please treat the the filenames as UTF-8 and internally convert them to UTF-16 to call the Unicode Windows APIs or only have a wchar_t* function available.\n\nDO NOT pass the filename as-is to the ANSI Windows APIs. With char * being treated as UTF-8 encoded text, this appears to work until an umlaut or another non-ASCII character appears in a filename.\n\nThank you.",
"sig": "eb46923fd8c6ebe2752a826a0afba91ec3d11bbbc2f8483d1c0d49122473bc030f7ac929250d817a7c0d39f64a4459ed21fd5a0a5a30c4f944d57dbdd8330a39"
}